Starting a second Antigravity thread resumes and cancels another thread's in-flight turn #43012
What happened#
An Antigravity thread was running a long turn: the model had issued a batch of ~19 edit_file calls and agy was executing them in order. While it was on the 16th, I started a new Antigravity thread on the same provider instance. Five seconds later the first thread failed with "Antigravity stopped this turn because of an error." The underlying agy error was:
agent executor error: expected pending tool step at index 211, got status CORTEX_STEP_STATUS_CANCELED
Sending "continue" recovered the thread, but the remaining edits from the batch were lost from the failed turn.
Diagnosis#
T3 spawns one agy acp process per thread, and every process gets the same --gemini-dir <profile> and --app-data-dir antigravity-acp (apps/server/src/provider/antigravityAuthSupport.ts, spawn args around line 558). On startup, agy treats any conversation in that directory still marked as running as "interrupted by server restart" and resumes it, even when another live agy process owns it.
From the new thread's agy log (18:43:12.664):
server.go:5311] Resuming 1 conversation(s) interrupted by server restart
The original conversation's trajectory DB then shows:
- steps 195–210 (edit_file): status 3 (done)
- steps 211–213 (2× edit_file, 1× run_command), queued at 18:42:18: status 6 (CANCELED), never executed
- step 214: error step with the executor error above, 18:43:17
- step 215: a planner response inside the same conversation, created 18:43:12, finished 18:44:08. This is the resumed turn driven by the second process, invisible to T3. It spans almost exactly the new thread's first turn (18:43:13.8–18:44:14.9).
T3 sent no session/cancel; the provider event log shows only the one session/prompt, which returned end_turn at 18:43:17.105. AntigravityTurnOutcome classifies the error as a generic provider_error, since it doesn't match the API_ERROR patterns.
The same happens on any agy startup: the process started for "continue" at 18:43:46 logged "Resuming 2 conversation(s) interrupted by server restart", which would include the second thread's conversation, still running at the time.
Steps to reproduce#
(Reconstructed from logs; not re-run deliberately.)
- Antigravity provider, full-access runtime mode.
- Thread A: give a task that makes the model issue a batch of parallel tool calls (e.g. "add t.Parallel() to every test in these 20 files"), so several tool steps are queued.
- While Thread A is executing the batch, create Thread B on the same Antigravity instance and send any message.
- Thread B's agy log shows "Resuming 1 conversation(s) interrupted by server restart"; Thread A's queued tool steps become CORTEX_STEP_STATUS_CANCELED and its turn fails with "expected pending tool step at index N".
Version#
Server (where the bug happened): 0.1.12-nightly.20261124.5178 (remote, linked environment) Antigravity CLI: 1.5.17 Client used to open triage: T3 Code Desktop 0.1.12-nightly.20261120.5009 (macOS). Triage CLI version is that client's.
Environment#
Remote T3 server on Linux x64 (cloud VM), accessed from T3 Code Desktop on macOS via a linked environment. Antigravity authenticated with a Gemini API key, model gemini-4-neon, full-access runtime mode.
Evidence#
providers/antigravity/<instance>/antigravity-acp/log/acp-server-…_184312-*.log: "Resuming 1 conversation(s) interrupted by server restart" at 18:43:12.664, one second after the new thread's agy process spawned.…_180116-*.log(Thread A's process): tool confirmation for step 210 at 18:43:17.021, then "agent executor error: expected pending tool step at index 211, got status CORTEX_STEP_STATUS_CANCELED" at 18:43:17.101.…_184346-*.log(process for "continue"): "Resuming 2 conversation(s) interrupted by server restart".conversations/<session>.dbstep table as summarized under Diagnosis.logs/provider/events.<thread>.log: no session/cancel; session/prompt started 18:01:17.544, succeeded 18:43:17.105.
Related issues#
#42581: same root cause (one agy process per thread sharing --app-data-dir), different symptom (OAuth MCP token rotation).
Workaround#
Don't start, reopen, or send to another Antigravity thread while one is mid-turn on the same instance. Untested: putting concurrent work on separate Antigravity provider instances, which get separate profile directories.
Agent#
Triaged with Claude Code (Claude Opus 5.5) running inside T3 Code.
vivekkairi(GitHub profile, opens in a new tab) added labelsvia-triage
tanstack-source added labelsbug
liuzhao1225(GitHub profile, opens in a new tab) linked this to #43675
Confirming this same shared
--app-data-dir antigravity-acpcollision still reproduces on T3 Codev0.1.13with Antigravity CLI1.5.22, and can also manifest asCORTEX_STEP_STATUS_WAITINGwhen a sibling process overwrites a queued parallel tool step.(Sharing this in part because automated verification on #43675 stalled assuming reproduction required
1.5.17/1.5.18— it is still active on1.5.22.)Environment#
- T3 Code: Desktop & local server
0.1.13(bc0f04da94f64b5e487c598761a43b4cf06b2ac9) - OS: Linux x64
- Antigravity CLI:
1.5.22(custombinaryPath), Gemini API key auth,full-accessruntime mode
What happened#
While Thread A was mid-turn (
16:15:12Z–16:24:46Z) on an Antigravity provider instance, two other Antigravity sessions spawned on the same provider instance (a delegated task at16:20:47Z, and Thread B woken by Thread A viat3_thread_sendat16:22:25Z). Allacpprocesses shared--gemini-dir <state-dir>/providers/antigravity/<instance-hash> --app-data-dir antigravity-acp(apps/server/src/provider/antigravityAuthSupport.ts:556-564).Thread A then failed with
"Antigravity stopped this turn because of an error."and underlying error:agent executor error: expected pending tool step at index 10338, got status CORTEX_STEP_STATUS_WAITING
Evidence#
- Sibling
acp-server-*.logfiles on startup:16:20:53Z:server.go:5604] Resuming 3 conversation(s) interrupted by server restart16:22:30Z:server.go:5604] Resuming 2 conversation(s) interrupted by server restart
- Thread A's trajectory DB (
conversations/<session>.db):- Step
10336(planner response,16:22:26Z–16:23:56Z) emitted two parallel tool calls:mcp_t3-code_t3_thread_wait(call_14839931790219472253, step10337, ran16:23:57Z–16:24:45.963Z) and arun_command(call_14839931790219470374, queued for step10338). - At
16:24:01.982Z, while step10337was blocked int3_thread_wait, a resumed sibling process overwrote step10338with a differentrun_command(call_8476567604136491500) that never appeared in step10336, leaving step10338inCORTEX_STEP_STATUS_WAITING. - When step
10337completed at16:24:45.963Z, Thread A'sAgentExecutor(agentexecutor.go:444) advanced to step10338expecting its own pending tool call and aborted at16:24:46.511Zwith theCORTEX_STEP_STATUS_WAITINGerror above (step10339).
- Step
logs/provider/events.<thread>.log: nosession/cancel;session/promptreturned at16:24:46.524Z.- Subsequent turns on Thread A continued seeing interleaved planner responses and
status=9(CORTEX_STEP_STATUS_WAITING) steps whenever another Antigravity thread spawned on the same instance.
Triaged with Antigravity (Gemini 4 Neon (High)) running inside T3 Code.
- T3 Code: Desktop & local server
Also reproduces on macOS (arm64), T3 Code Desktop 0.1.13, managed Antigravity CLI 1.5.20, Gemini 4 Neon (High). Error here:
agent executor error: expected pending tool step at index 300, got status CORTEX_STEP_STATUS_WAITING.Trigger#
A scheduled task (automation) started a turn on Thread A. The model emitted a planner step with four parallel tool calls (three MCP
t3_thread_readand onerun_command). Over the next 10 seconds T3 spawned two moreagy acpprocesses for other threads. All of them had the same--gemini-dir <profile> --app-data-dir antigravity-acp. At the moment of this capture there were 21 liveagy acpprocesses sharing that directory.Timeline (UTC, from server trace and the conversation transcript)#
00:52:07: Thread A's turn starts and emits the parallel tool batch.00:52:11: T3 starts a newagy acpprocess (AntigravityDriver.startCompatible).00:52:13: Thread A's transcript gets[Notice] All your background tasks have been stopped due to server restart...and a second planner response.00:52:15: T3 starts anotheragy acpprocess.00:52:17: A second restart notice and another planner response land in Thread A.- Thread A then fails at step 300 with the WAITING error.
Two side effects not covered above#
- Duplicate step indices. Steps 298 and 299 each appear twice in Thread A's
transcript_full.jsonl. Each pair has one entry from the owning process and one from the process that resumed the conversation. - HTTP 401 against T3's MCP endpoint. One of the resumed tool calls failed with
calling "tools/call": T3 Code MCP endpoint responded with HTTP 401. The resumed process seems to call T3's MCP server with credentials that don't belong to that thread. This probably overlaps with #42581.
Idle conversations are affected too. Two other conversations that had been finished for 20+ minutes received the same restart notices at
00:52:13and00:52:16/17, and the model produced a new planner response in each of them. That turn is invisible to T3 and still spends model tokens. When the T3 app restarted at01:01, about 150 restart notices were written across conversations within 10 seconds.+1 to landing the per-session
--app-data-dirisolation in #43675.
Triaged with Claude Code (Claude Opus 5.5) running inside T3 Code.
Sign in to join this conversation.
Note
🤖 Gemini 4 Neon responding on behalf of justcarlson
Field data supporting the shared
--app-data-dirdiagnosis:On
v0.1.12-nightly.20261123.5151pinned to managedagy 1.5.13, we audited 361acp-server-*.logfiles with concurrent Antigravity threads sharing--app-data-dir antigravity-acpand saw 0CORTEX_STEP_STATUS_CANCELEDcollisions. We are holding managedagyat1.5.13rather than updating to1.5.17until this is resolved.Suggested direction (judgment, not tested): give each spawned
agy acpprocess its own session state directory (for exampleantigravity-acp/<sessionId>) while keeping auth/profile state shared if needed, so a newly started ACP process cannot recover or cancel a live sibling's in-flight conversation.