Repository navigation
fix(antigravity): make agy actually reach worker_done as a supervised worker - #1
Merged
nwparker merged 1 commit intoSep 21, 2026
Conversation
Three defects each blocked `orchestration worker-start --agent antigravity --worktree new-child` at the agent_readiness stage. 1. Readiness never fired. The composer check required the trimmed line to be exactly one character, but agy 1.2.7 launches in accept-edits mode and paints it into the caret row (`> Accept-edits mode: ...`). Widened narrowly to a bare `>` or `> <name> mode:`; matching any `> <text>` would make every menu dialog read as ready, since they all prefix their highlighted row the same way. 2. No trust artifact for agy. Added markAntigravityWorkspaceTrusted, writing ~/.gemini/antigravity-cli/settings.json under `trustedWorkspaces` — verified empirically against agy 1.2.7, and distinct from the Gemini CLI's trustedFolders.json, which agy does not consult. Trust is exact-path and not inherited by subdirectories, so each child worktree needs its own entry. 3. The orchestration path skipped the preset. Orca has two trust dispatch chains: the renderer's preflightAgentTrust and the main-process markLocalWorktreeTrusted. worker-start only takes the second, which matched cursor/copilot/codex and fell through for antigravity, so the trust write never happened while renderer-side tests passed. Verified live end to end: the dispatch settles `succeeded` with worker_done carrying the right task and dispatch ids, and the worktree is appended to agy's settings with sibling keys untouched. Known gap: remote-agent-trust-presets.ts has no antigravity branch. The SSH artifact path is unverified, so agy over SSH still stalls at agent_readiness. Recorded in a comment there rather than guessed at.
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.
Builds on stablyai#21705 (this targets
agy-supervised-workerdirectly, so it stays one PR upstream).I tried to run
orca orchestration worker-start --agent antigravity --worktree new-childagainst your branch and it still failed atagent_readiness. Three separate defects; each one alone is enough to stop every supervised agy worker.1. Readiness never fires on a default agy launch
The composer check required the trimmed line to be exactly one character. agy 1.2.7 launches in accept-edits mode and paints it into the caret row:
Measured directly with a PTY capture of agy 1.2.7:
agentModein~/.gemini/antigravity-cli/settings.json>accept-edits> Accept-edits mode: file edits auto-approved (shift+tab to cycle)Widened to a bare
>or> <name> mode:. Deliberately narrow: every agy dialog prefixes its highlighted row with>(> Yes, I trust this folder,> Gemini 3.8 Flash), so matching any> <text>would make menus read as ready. There is a regression test for exactly that.2. No trust artifact for agy
Added
markAntigravityWorkspaceTrusted, writing~/.gemini/antigravity-cli/settings.jsonundertrustedWorkspaces. Verified empirically against agy 1.2.7 — and note this is not~/.gemini/trustedFolders.json, which belongs to the Gemini CLI and which agy does not consult.Trust is exact-path and not inherited by subdirectories:
C:\Users\<user>was already trusted, yet launching agy in a descendant still raised the prompt and appended the descendant separately. So every child worktree needs its own entry, which is what makes the per-worktree preflight necessary rather than merely convenient.3. The orchestration path skipped the preset entirely
This is the one worth a close look, because it is invisible to unit tests.
Orca has two trust dispatch chains:
preflightAgentTrust→ IPCagentTrust:markTrustedmarkLocalWorktreeTrustedinruntime-worktree-agent-startup.tsorchestration worker-startonly ever takes the second. It matchedcursor/copilot/codexand fell straight through forantigravity, so addingpreflightTrust: 'antigravity'clears the!presetguard and then does nothing. Renderer-side tests pass while every supervised worker still dies atagent_readiness.I only found this from a live run; the unit suite was green the whole time it was broken.
Verification
Live, not just unit tests: the dispatch settles
succeeded/stage=settled,worker_donearrives carrying the correcttaskIdanddispatchId, and the new worktree is appended to agy's settings with all sibling keys (agentMode,model,permissions, …) untouched.62 tests pass across the five affected files;
typecheck:nodeis clean. Each fix has a regression test — I verified they are real by reverting each fix individually and confirming exactly the expected test fails.Known gap, left deliberately
remote-agent-trust-presets.tshas noantigravitybranch. The SSH-side artifact path is unverified, so agy over SSH still stalls atagent_readiness. I recorded that as a comment there rather than guessing at a remote path I could not test.One note for reviewers
Because turn start for agy rests solely on a hook row (agy emits no OSC title, and is absent from
SYNTHETIC_AGENT_TITLE_AGENTS), a cold start currently exceeds the flat 30sAGENT_PROMPT_EFFECT_TIMEOUT_MSwhile agy is still onSigning in.... The dispatch reportsoutcome_unknown/turn_start_unobservedand then settles correctly onceworker_donelands. Not fixed here — it needs a per-agent budget inresolveAgentPromptEffectTimeoutMs— but it is cosmetic-but-misleading rather than fatal, and worth knowing about.