[Bug]: Antigravity threads ignore AGENTS.md and GEMINI.md rules
Before submitting
- [x] I searched existing issues and did not find a duplicate.
- [x] I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
- Open a project that has an AGENTS.md at its root.
- Start an Antigravity thread in that project.
- Ask: "Without using any tools, quote a line from your AGENTS.md rules."
Expected behavior
Antigravity follows the project's AGENTS.md (and the global ~/.gemini/GEMINI.md), the same way the agy CLI and the Antigravity app do. Claude Code, Codex and OpenCode threads in T3 all pick up their rules files.
Actual behavior
Antigravity says it has no rules files loaded. Its only instructions are its own system prompt and T3's <t3_code_instructions>, <pull_request_linking> and <runtime_info> blocks. It ignored every location I tried:
- the project's AGENTS.md
- GEMINI.md, AGENTS.md and
rules/in the private GEMINI_HOME and in~/.gemini/config - a plugin with
rules/AGENTS.mdin both config roots
The root cause is upstream. The Antigravity ACP server builds the session config in _create_agent_config with no rules or system instructions, so the harness loads none. It also drops hook injection: hooks.py logs "Trajectory injection (injectSteps) is not supported by the SDK yet", so a PreInvocation hook can't add them either.
T3 already works round the same gap for its own instructions. t3AcpPromptWithInstructions in packages/provider-core/src/server/orchestrationInstructions.ts adds them to the first prompt and adds them again after compaction ("ACP lacks system/developer fields; inject context on first prompt"). Including the project's AGENTS.md (and ~/.gemini/GEMINI.md) in that block for Antigravity would fix this. Happy to send a PR for that if you agree with the direction.
Impact
Major degradation or frequent failure
Antigravity ignores repo rules without any warning, so it doesn't follow project conventions that every other provider in T3 follows.
Version or commit
0.1.6-nightly.20261030.3940
Environment
macOS 27 (Apple Silicon) and Ubuntu (x64) via a linked environment, Antigravity ACP server bundled by T3, Claude Opus 5.5 (Medium) through Antigravity
Workaround
None that's clean. Asking the agent to read AGENTS.md with a tool at the start of each thread works, but the rules drop out on compaction.
[!NOTE] 🤖 GPT-6.1 Sol responding on behalf of Whamp
Independent reproduction on Linux x86_64, 2026-11-06: Antigravity ACP 1.4.5 still omits global and workspace rules. Linking workspace GEMINI.md to AGENTS.md did not fix discovery. A positive control using the native system-prompt append mechanism used by #29197 returned every exact marker.
| Fresh process/session | Exact markers returned | Observed tool events |
|---|---|---|
Global GEMINI.md, project AGENTS.md and GEMINI.md, all regular files |
0/3 | 0 |
Global rules plus project GEMINI.md -> AGENTS.md |
0/2 | 0 |
Three regular files supplied through _meta.antigravity.systemPrompt.append |
3/3 | 0 |
All three model turns ended with end_turn; all three owned runtime processes exited 0. Model: gemini-3.8-flash-low, using the existing OAuth sign-in.
Reproduction setup:
- Use Google's
agy-acp-server-1.4.5-linux-x86_64.zip. The archive SHA-256 matched the release manifest at the PR base:923923a0d7dc8073f66cc6f78647a3107e3a7ee2b7e1a24df8b3927b5188013b. ACPinitializereportedantigravity-acpversion1.4.5. - Use a fresh workspace and isolated
HOME/GEMINI_HOME=$HOME/.gemini. Put a different random marker in each of$HOME/.gemini/GEMINI.md, workspaceAGENTS.md, and workspaceGEMINI.md. The fixture also exposed globalAGENTS.md -> GEMINI.md. - Open
session/newwith that workspace, no MCP servers, and_meta.antigravity.disabledTools=["run_workflow"]. Select the model above. - Send this prompt, without including any expected marker values:
Without using any tools or reading any files, return only a JSON object with global_marker, project_marker, and gemini_marker from your initial instructions. Use null for each marker that is absent. Do not guess.
Both automatic-discovery cases returned:
{"global_marker":null,"project_marker":null,"gemini_marker":null}
For the positive control, repeat in a fresh process/session and include the three file contents, in global/AGENTS/GEMINI order, in session/new:
{"_meta":{"antigravity":{"disabledTools":["run_workflow"],"systemPrompt":{"append":"<the three fixture file contents>"}}}}
That control returned all three exact random values. Client tool requests were denied, and no tool-call notifications were observed.
Limits: this exercised the real ACP runtime directly, not a patched T3 build. It supports the PR's native transport mechanism but does not verify the full adapter change, workspace changes, rule precedence, or retention after compaction. The test copy did not replace the installed runtime. Credentials and private runtime logs are omitted.
This adds an independent Linux reproduction and native evidence for #29197. Could a maintainer assess the linked fix and its remaining review requirements?
We measured this on Windows with a local T3 Code build of 2026-11-08 (Antigravity over ACP).
Setup: one repository whose root AGENTS.md (38 KB, identical to CLAUDE.md) holds two unique facts. Per provider, four child threads:
- a negative control (a value that exists nowhere),
- and 3. one fact each, "answer from what you already know, do not use any tool",
- "read
AGENTS.mdand quote its first line".
Results:
- Grok children: both facts answered, with no tool call before the answer. The project rules were in context at start.
- Antigravity children (gemini-3.8-flash-low): both facts answered
UNKNOWN, with no tool call. The explicit read (4) worked. - agy CLI 1.5.3 outside T3 (
agy -p, scratch repository withAGENTS.md): the file value was answered in one turn with no tool, so the CLI path loadsAGENTS.md.
So the gap is on the T3 ACP path, as this issue says. #29197 would cover our case (we use AGENTS.md). Until it lands, we put the needed rules into each Antigravity child task. Raw outputs are available if useful.
Same result on macOS (arm64), T3 Code 0.1.3 with the bundled Antigravity ACP runtime, 2026-11-10.
I put a canary word in each of: $GEMINI_HOME/config/AGENTS.md, $GEMINI_HOME/config/rules/*.md (with trigger: always_on), $GEMINI_HOME/GEMINI.md, $GEMINI_HOME/antigravity-cli/rules/*.md, ~/.gemini/config/AGENTS.md, plus the workspace's root AGENTS.md. After a full T3 Code restart, a new Antigravity thread asked to answer from context without tools found none of them. Skills from the workspace's .agents/skills did load.
Claude and Codex threads in the same workspace load the same global and project AGENTS.md files. +1 for #29197.
Same on Ubuntu 24.04 (x86_64), T3 Code 0.1.6 stable, bundled Antigravity ACP 1.4.1, gemini-3.8-flash, 2026-11-10.
Fresh threads (top-level and delegate_task children) found no rules from any of: the private GEMINI_HOME's config/AGENTS.md, a copy placed in its config/skills/, ~/.gemini/config/AGENTS.md, or an AGENTS.md at the workspace root. Claude Code and Codex threads on the same machine quote the same file.
One extra data point: a hooks.json in that same private config/ folder is honored (a PreToolUse command hook denied a git push from an Antigravity thread), so the ACP server does read config/ for hooks. The harness just never gets a rules path: the session config it builds carries workspaces, tools, mcp_servers, skills_paths and hooks, while the harness binary has unused config keys for rules_paths, config_dir and personal customizations.
+1 for #29197. Until it lands we paste the rules into each Antigravity child task. Happy to test a Linux nightly that includes the PR.
Confirming this still reproduces on T3 Code v0.1.9 (stable) with Antigravity ACP v1.4.5 (gemini-4-hydrogen).
Environment
- OS: Zorin OS 18.1 (Ubuntu 24.04
noblebase,x86_64) - T3 Code:
v0.1.9(stable) - Provider: Antigravity ACP
v1.4.5(gemini-4-hydrogen)
Observed Behavior
I have global/parent user rules configured in ~/.gemini/GEMINI.md and ~/.agents/AGENTS.md (via symlinks).
When given the exact same prompt (without using any tools) asking whether it knows my user rules, agy CLI loads them while T3 Code does not:
| T3 Code (Antigravity ACP) | agy CLI |
|---|---|
+1 for #29197.
Adding one more point on why this shouldn't end up closed as not planned like earlier issue #15283:
When #15283 was closed on Oct 21 ("This fault is outside T3 Code, so we cannot fix it here"), ACP _meta.systemPrompt.append was ignored on agy 1.2.16, so T3 had no native system-prompt mechanism for Antigravity.
That has changed on Antigravity ACP 1.4.5:
session/new._meta.antigravity.systemPrompt.appendworks natively now.- T3 Code's
AntigravityAdapterV2.tsalready usessessionSystemPromptAppendto passPULL_REQUEST_LINKING_INSTRUCTIONS—as shown in my T3 screenshot above,<pull_request_linking>is present in context while~/.gemini/GEMINI.mdis missing.
So unlike when #15283 was closed, T3 already has a working native channel for Antigravity instructions and doesn't have to wait on upstream.
New data point on Windows with the native 1.5.x runtime, 2026-11-15: workspace rules now load in T3, but global rules still don't, because T3 starts Antigravity with a private --gemini-dir.
Environment
- Windows 11 (x64)
- T3 Code
0.1.10-nightly.20261115.4723 - Managed Antigravity runtime
1.5.9, started asagy.exe acp --gemini-dir <T3 userdata>\providers\antigravity\<instance> --app-data-dir antigravity-acp - Model
gemini-4-hydrogen
Test
Fresh Antigravity threads in a project with a root AGENTS.md. Prompt: "Without using any tools, quote a section of this project's AGENTS.md and the response-language rule from your global rules; say UNKNOWN if they were not in your initial instructions." No tool calls were made in any run.
| Runtime | Project AGENTS.md |
Global rules |
|---|---|---|
T3, previously managed agy_acp_server (1.4.x), same machine earlier the same day |
not loaded | not loaded |
T3, managed agy acp 1.5.9, rules in ~/.gemini/AGENTS.md |
loaded | not loaded |
T3, managed agy acp 1.5.9, AGENTS.md added to the private --gemini-dir folder |
loaded | loaded |
Standalone agy -p 1.5.9 and agy acp 1.5.9 (default gemini dir), rules in ~/.gemini/AGENTS.md |
loaded | loaded |
I also ran standalone agy acp --gemini-dir <scratch dir> with a marker in <scratch dir>/AGENTS.md. The marker was returned without tools, so the 1.5.9 runtime reads global rules from whatever --gemini-dir points to.
What this suggests
- On the native 1.5.x runtime, workspace rule loading works without any T3 change.
- The remaining gap is global rules. T3's private
--gemini-dirhides~/.gemini/AGENTS.md/GEMINI.md, unlike the standalone CLI. - Workaround: put the global rules file (or a symlink to it) at
<private gemini-dir>\AGENTS.md. It stops working if T3 recreates that instance folder. - For #29197: on 1.5.x, workspace
AGENTS.mdis already loaded natively. Injecting it again may duplicate it. I have not verified this.
Not tested: GEMINI.md in the private folder, and whether the rules are kept after compaction.
Adding a follow-up note regarding official Antigravity global rule paths and PR #29197 (reproduced on Linux x86_64, T3 Code 0.1.9 + managed agy_acp_server.par 1.4.5, gemini-4-hydrogen).
1. Official Antigravity Global Rules Specification
Per the Google Antigravity Rules docs (#global-rules), Antigravity documents four standalone always_on global rule files (not just ~/.gemini/GEMINI.md), plus modular rules:
~/.gemini/AGENTS.md~/.gemini/GEMINI.md~/.gemini/config/AGENTS.md~/.gemini/config/GEMINI.md(used by Antigravity for Antigravity-only global rules)~/.gemini/config/rules/*.md(YAML frontmattertriggerrules, e.g.trigger: always_on)
2. Gaps to note for #29197 / T3's --gemini-dir isolation
- Missing global paths in #29197: PR #29197 currently only reads
~/.gemini/GEMINI.md(alongside workspaceAGENTS.md/GEMINI.md), so users who follow Antigravity's documentation and place global rules in~/.gemini/config/GEMINI.md,~/.gemini/AGENTS.md,~/.gemini/config/AGENTS.md, or~/.gemini/config/rules/*.mdwill still have their global instructions ignored. - Interaction with
--gemini-diron1.5.x+ avoiding duplicate workspace injection: As @rafalePOP observed on0.1.10-nightly+1.5.9, when T3 passes--gemini-dir <T3 userdata>/providers/antigravity/<instance>, Antigravity's native global rule lookup is redirected into that private T3 directory instead of~/.gemini/. Even when the underlyingagy acpruntime supports native rules discovery, T3 will still need to either:- read and inject the user's
~/.gemini/*global rule files (or offer a dedicated global instructions setting for Antigravity in T3 settings), while avoiding duplicating workspace rules on1.5.x+runtimes that already load them natively.
- read and inject the user's
Sharing an update tested on Antigravity ACP Server 1.5.9 (T3 Code 0.1.11-nightly.20261117.4814):
Unlike 1.4.5, agy 1.5.9 acp now natively loads <gemini-dir>/GEMINI.md, <gemini-dir>/config/AGENTS.md, workspace AGENTS.md, and <gemini-dir>/config/hooks.json (including symlink deduplication and @[label](path) expansion).
The reason global rules/hooks still don't load in T3 Code is that T3 launches agy acp with an isolated --gemini-dir (~/.t3/userdata/providers/antigravity/<hash>/), and linkAntigravityUserSkills only symlinks skills from ~/.gemini—leaving ~/.gemini/GEMINI.md, ~/.gemini/config/AGENTS.md, ~/.gemini/config/hooks.json, and ~/.gemini/config.json unlinked.
For comparison, Claude Code keeps settingSources: ["user", "project", "local"] (unless a custom home is configured) and Codex shares CODEX_HOME. Extending T3's profile symlinks (or opt-in user-config linking, noting #31352's .agents/hooks.json boundary) would let agy 1.5.9 handle rules and hooks natively without T3 needing to inline rule files into system prompts.
[!NOTE] Written by Claude Opus 5.5 on my behalf, from tests run on my machine today.
Another data point from macOS, and a possible reason why some installs still see no global rules on a current nightly: the managed Antigravity runtime is never updated, so T3 keeps launching agy_acp_server 1.1.1 without --gemini-dir.
Environment
- macOS 27 (Apple Silicon)
- T3 Code
0.1.11-nightly.20261119.4918 - Antigravity provider with an empty
binaryPath(managed runtime) agyCLI 1.5.10 also installed (~/.local/bin/agy), not used by T3- Model
gemini-4-neon(low and medium), throughdelegate_taskchildren
What T3 actually starts
While an Antigravity child was running, ps showed only:
~/.t3/tools/antigravity-acp/darwin-arm64/versions/<releaseId>/agy_acp_server.par
with no arguments. .install-complete.json in that folder says "version": "agy_acp_server_1.1.1", and the folder dates from the first install (2026-09-05). active.json still points to that release. So the harnessPath !== null branch of buildAntigravityAcpSpawnInput is taken, and --gemini-dir is never passed. The provider status in T3 also reports agy_acp_server_1.1.1.
Tests
Each run was a fresh child that reported its initial context before reading any file.
| Rules file added | Global rules in context |
|---|---|
none (only ~/.gemini/GEMINI.md, a symlink to a shared rules file) |
none |
~/.gemini/config/GEMINI.md (symlink) |
none |
<private profile>/GEMINI.md (symlink) |
none |
<private profile>/config/GEMINI.md (symlink) |
none |
In every run the skills linked by linkAntigravityUserSkills (<private profile>/config/skills) were visible. The child could also read ~/.gemini/GEMINI.md with a shell tool and quote it correctly. Only the automatic loading is missing.
The comments above report that agy acp 1.5.9 reads <gemini-dir>/GEMINI.md. My results don't contradict that: this install never runs 1.5.x.
Suggestions
- Update the managed runtime on existing installs, or at least show in the provider status when a newer release is available.
- Link
GEMINI.md,AGENTS.mdandconfig/rules/from~/.geminiinto the private profile next toskills(as suggested above), or land #29197. Either fixes 1.5.x. On 1.1.1 only the prompt injection path of #29197 would help.
Workaround until then: every Antigravity brief asks the agent to read ~/.gemini/GEMINI.md first, enforced by a local PreToolUse hook on delegate_task.
Confirming on Linux (stable AppImage) as well: T3's managed runtime is agy_acp_server.par 1.4.1, which leaves harness_config.rules_config.filenames empty so neither ~/.gemini/GEMINI.md nor workspace AGENTS.md is loaded.
Temporarily patching _build_harness_config() in agy_acp_server.par (as documented in #15283) immediately restores both ~/.gemini/GEMINI.md and workspace AGENTS.md into <user_rules>. Looking forward to #29197 / upgrading the managed runtime and linking ~/.gemini/GEMINI.md into the isolated profile directory.
Repro on current main, and the fix to make
main @ 09b79941a52, Linux x86_64, native agy 1.5.12, Google personal sign-in, Gemini 3.8 Flash. I placed three temporary markers:
- a project
AGENTS.mdin the workspace ("end every reply with PINEAPPLE"); - a global
~/.gemini/AGENTS.md("end every reply with MANGO"); - a global skill
~/.gemini/config/skills/canary-color/SKILL.md.
I asked the same question through agy -p and through a T3 Antigravity thread:
agy directly |
T3 thread | |
|---|---|---|
Project AGENTS.md |
read (PINEAPPLE) | read (PINEAPPLE) |
Global ~/.gemini/AGENTS.md |
read (MANGO) | ignored (no MANGO) |
Global skill in ~/.gemini/config/skills |
listed | listed |
Cause. T3 gives each Antigravity instance a private GEMINI_HOME (<userdata>/providers/antigravity/<sha256(instanceId)>) so credentials, hooks and MCP config stay per instance. linkAntigravityUserSkills in apps/server/src/provider/antigravityAuthSupport.ts then links the user's global skill folders (~/.gemini/config/skills, ~/.gemini/antigravity-cli/skills) into that profile. Nothing does the same for the global rule files, so agy looks for GEMINI.md / AGENTS.md in an empty private profile. The agy 1.5.12 binary resolves these as ~/.gemini/GEMINI.md and ~/.gemini/AGENTS.md, relative to GEMINI_HOME.
Fix (keep it small). Link the user's ~/.gemini/GEMINI.md and ~/.gemini/AGENTS.md into the instance profile the same way the skill folders are linked: a symlink when the file exists, removed when it doesn't, and not overwriting a real file in the profile. Then agy reads them natively. Don't inject rule text into T3's instructions, and don't restart sessions on workspace change. #29197 did both and is being closed in favour of this.
Fixed looks like: with a global ~/.gemini/AGENTS.md, a T3 Antigravity thread follows it, exactly as agy run directly does. Removing the file stops it. Project AGENTS.md and global skills keep working. Add a test beside the existing skill-link tests. This can be proven on nucbox-1 with the same markers.
Reports: sicutlegga, ducktaperules, OanaGoge.