fix(server): resume Antigravity 404s that follow a mid-turn steer #46283
main fromrefs/pull/46283/head·merged by juliusmarminge View on GitHubProblem#
In #39869, AntigravityTurnOutcome began classifying mid-turn HTTP 404 NOT_FOUND responses as transient (retryable: true, resumeWith: "continue") when step?.reachedModel === true (SELECT 1 FROM steps WHERE idx > startIndex AND step_type = 15 LIMIT 1).
However, when a running turn is steered via steerWithPrompt (packages/provider-acp/src/server/adapter.ts), it calls flavor.watchPromptOutcome(context.nativeThreadId) again, advancing startIndex past all pre-steer steps. If the first model request after the steer hits a transient edge 404 before writing a new step_type = 15 planner response, reachedModel evaluates to false and the turn fails immediately with retryable: false instead of resuming once.
Change#
packages/provider-acp/src/server/adapter.ts: ExtendAcpAdapterV2Flavor.watchPromptOutcomewith an optional secondturnStart?: AcpPromptOutcomeCheckparameter, store the turn's initial outcome check onActiveAcpTurn.turnOutcomeCheck(and initialize it on the first prompt-steer if a wake/continuation turn had no initial prompt), and pass it wheneversteerWithPromptre-armswatchPromptOutcome.apps/server/src/provider/acp/AntigravityTurnOutcome.ts: Record each prompt check's baseline (root,sessionId, filedev/inoidentity,startIndex) in a module-levelWeakMap. InlastStepAfter(index, turnStartIndex), keep the final-step query strictly anchored to the current prompt (idx > index) so an earlier error step is never misread, while checkingreachedModel(step_type = 15) fromturnStartIndexwhenever the baseline belongs to the same profile root, session, and unlinked SQLite file (turnStartIndex <= index).apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.ts: ForwardturnStarttowatchAntigravityPromptOutcome.apps/server/src/provider/acp/AntigravityTurnOutcome.test.ts&apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.ts: Add focused unit and adapter regression tests covering post-steer transient 404 recovery, no-model-reply 404 fast-fail, pre-steer errors not leaking into post-steer checks, andturnStartforwarding on both usersteerTurnand auto-resume steers.
Scope#
Fixes #46272 (bug fix / follow-up to #39869). Keeps single-retry outcomeResumed, 5xx handling, and retired-prompt behavior unchanged.
Verification#
- Fail-first check: Reverted the three production files to
upstream/main(6ae2b5146f) while keeping the new tests — bothAntigravityTurnOutcome.test.ts(missingresumeWith: "continue"on post-steer 404) andAcpAdapterV2.test.ts(turnStartsallundefined) failed as expected, then passed once the fix was restored. - Focused suite (
apps/server):vp test run src/provider/acp/AntigravityTurnOutcome.test.ts src/orchestration-v2/Adapters/AcpAdapterV2.test.ts src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts— 3 files, 239 tests passed. - Changed checks (
4121e1b96evsupstream/main6ae2b5146f):vp run check:changed upstream/mainexited0:format: pass (0.3s)lint: pass (0.6s, 0 warnings / 0 errors)knip: pass (5.0s)graphql (apps/server): pass (0.6s)typecheck (14 packages): pass (7.3s)test (5 files, 243 tests): pass (42.0s)
Authored by Claude Opus 5.5 (Claude Code harness); independently reviewed and verified by Gemini 4 Neon (Antigravity harness).
- 1
- 2
Pushed668b732
Evidence#
Real web app, Chromium 1280×800 (DPR 2), light theme, fresh isolated databases. Actual Antigravity 1.5.20 with Gemini API-key authentication through the supplied hub; Gemini 3.8 Flash, Low, Full access.
On both commits, requested a model reply followed by three sequential foreground shell calls (
sleep 8; printf "step complete\\n", WaitMsBeforeAsync 10000). After the first reply, sent a steer while work remained active. The forwarding proxy returned one HTTP 404 NOT_FOUND before any post-steer model reply, then passed subsequent traffic through. No manual follow-up was sent.Before After df49b4e9d6 668b732d48 

Before interaction recording After interaction recording Provider error; no completion; zero automatic continue messages. Automatically recovered, sent continue exactly once, and completed the sequence. Browser driver · Fault-injection forwarding proxy · Proxy request/status log
Native runtime records independently confirm the continue count: base summary, head summary, read-only summary extractor. Head steps show model reply → steer → 404 → one continue → remaining tools → final reply.
Head negative-control recording: a new-turn 404 before its first model reply still fails immediately; no additional continue was sent.
Recordings retain the scripted interaction in real time. Sidebars containing host identifiers are cropped out. Stills retain transcript regions verified identical across captures over 500 ms apart. The base still dismisses only the redundant error toast; the provider error remains visible.
Not shown:
- Google-account sign-in and other Antigravity runtime versions/models were not exercised; the reproduced comparison uses the available Gemini API-key mode with agy 1.5.20 and Gemini 3.8 Flash.
juliusmarminge added labelstakeover:ready
juliusmarminge removed labelstakeover:in-progress
juliusmarminge merged this479c042
juliusmarminge closed this
juliusmarminge removed labelstakeover:ready
Sign in to join this conversation.
coderabbitai[bot](GitHub profile, opens in a new tab) reviewed
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
⚠️ Outside diff range comments (1)
adapter.ts:1117522361a33-c455-4714-bc09-3427a4ab9651Reviewing files that changed from the base of the PR and between 4121e1b96e0307d3d7f53544b8369768f6af059d and 668b732d486ee4dbb0c20afc9b46adc3c49fafce.
apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.tspackages/provider-acp/src/server/adapter.tsIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.