fix(agentic): root Antigravity runs at the requested cwd - #1063
Merged
Conversation
`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
Closed
4 tasks
This was referenced Aug 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
agy --printroots its workspace at~/.gemini/antigravity-cli/scratchunless a project issupplied. The adapter passed
cwdandagy'sinitevent echoed it back, so the mismatch wassilent — the agent simply read somewhere else. The
headlessprobe only echoes a marker, so itpassed anyway.
Found while smoke-testing Antigravity ahead of an unattended run train.
Changes
--new-projectwhen no--projectis supplied, rooting the workspace atcwdunattendedrequest flag trading--sandboxfor--dangerously-skip-permissions;the default is unchanged
structured_outputderived from the probe instead of pinned tounsupported(CLI 1.1.8 added--output-format json|stream-json)Evidence
Direct, on CLI 1.1.9:
--new-project, reading a file that exists incwd:"The file
a.txtdoes not exist in the current directory (/home/codex/.gemini/antigravity-cli/scratch)"--new-project: returnsalpha, the actual contents--new-project:A=alpha B=bravo, two parallel subagents, fixture intactUnder
--dangerously-skip-permissionswithout the fix, subagents created the files they couldnot find, with invented contents, and reported success — the original
alpha/bravofixture wasoverwritten with
foo/bar.Through the tool, live
headlessprobe:["timeout"][]unsupported(pinned)unknown(no structured probe yet)deno test .llm/tools/agentic/runtime/— 154 passed, 0 failed.Acceptance evidence
cwdand can read files there. — verified before/after;--new-projectreturns real file contents where the unfixed invocation reports the scratch pathunattendedflag;--sandboxremains the default branchstructured_outputreflects what the installed CLI does rather than a pinned constant. — derived fromobservation.structuredOutputParsed, with a test for supported and unsupportedheadlessprobe reports no failure signals. —failureSignals: [], down from["timeout"]Closes #1062
🤖 Generated with Claude Code
https://claude.ai/code/session_01RLqimdJHXcojxbUGBPVfci