Skip to content

fix(agentic): root Antigravity runs at the requested cwd - #1063

Merged
rickylabs merged 1 commit into
mainfrom
fix/agy-workspace-rooting
Aug 2, 2026
Merged

fix(agentic): root Antigravity runs at the requested cwd#1063
rickylabs merged 1 commit into
mainfrom
fix/agy-workspace-rooting

Conversation

@rickylabs

Copy link
Copy Markdown
Owner

Summary

agy --print roots its workspace at ~/.gemini/antigravity-cli/scratch unless a project is
supplied. The adapter passed cwd and agy's init event echoed it back, so the mismatch was
silent — the agent simply read somewhere else. The headless probe only echoes a marker, so it
passed anyway.

Found while smoke-testing Antigravity ahead of an unattended run train.

Changes

  • --new-project when no --project is supplied, rooting the workspace at cwd
  • an opt-in unattended request flag trading --sandbox for --dangerously-skip-permissions;
    the default is unchanged
  • structured_output derived from the probe instead of pinned to unsupported (CLI 1.1.8 added
    --output-format json|stream-json)

Evidence

Direct, on CLI 1.1.9:

  • without --new-project, reading a file that exists in cwd:
    "The file a.txt does not exist in the current directory (/home/codex/.gemini/antigravity-cli/scratch)"
  • with --new-project: returns alpha, the actual contents
  • subagent swarm with --new-project: A=alpha B=bravo, two parallel subagents, fixture intact

Under --dangerously-skip-permissions without the fix, subagents created the files they could
not find, with invented contents, and reported success — the original alpha/bravo fixture was
overwritten with foo/bar.

Through the tool, live headless probe:

before after
status passed passed
failureSignals ["timeout"] []
structured_output unsupported (pinned) unknown (no structured probe yet)

deno test .llm/tools/agentic/runtime/ — 154 passed, 0 failed.

Acceptance evidence

  • An Antigravity run driven through the adapter operates in the requested cwd and can read files there. — verified before/after; --new-project returns real file contents where the unfixed invocation reports the scratch path
  • Unattended runs can opt out of the sandbox explicitly, and the default stays sandboxed. — unattended flag; --sandbox remains the default branch
  • structured_output reflects what the installed CLI does rather than a pinned constant. — derived from observation.structuredOutputParsed, with a test for supported and unsupported
  • The live headless probe reports no failure signals. — failureSignals: [], down from ["timeout"]

Closes #1062

🤖 Generated with Claude Code

https://claude.ai/code/session_01RLqimdJHXcojxbUGBPVfci

`agy --print` roots its workspace at `~/.gemini/antigravity-cli/scratch` unless a
project is supplied. The adapter passed `cwd` to the subprocess and `agy`'s init
event echoed it back, so the mismatch was invisible — but the agent was reading
somewhere else. A probe that only echoes a marker passed regardless, which is why
this survived. Passing `--new-project` when no project is given roots it at `cwd`.

Observed on 1.1.9 under skipped permissions: asked to read two files it could not
see, it spawned subagents that created them with invented contents and reported
success. Fabrication, not failure — worth fixing before any unattended run.

Also adds an opt-in `unattended` flag trading `--sandbox` for
`--dangerously-skip-permissions`, because in print mode a permission prompt returns
an empty response with exit 0 rather than failing, which reads as a successful
no-op and silently wastes a run. The default stays sandboxed.

`structured_output` was pinned to `unsupported`; CLI 1.1.8 added
`--output-format json|stream-json`, so it is now read from the probe.

The live headless probe went from reporting a `timeout` failure signal to none.

Closes #1062

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RLqimdJHXcojxbUGBPVfci
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(agentic): Antigravity runs are rooted in a scratch directory, not the requested cwd

1 participant