Skip to content
Source
Sign inSign up
pingdotgg/t3code

Starting a second Antigravity thread resumes and cancels another thread's in-flight turn #43012

Openvivekkairi(GitHub profile, opens in a new tab) opened this issue 3 comments

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.)

  1. Antigravity provider, full-access runtime mode.
  2. 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.
  3. While Thread A is executing the batch, create Thread B on the same Antigravity instance and send any message.
  4. 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>.db step 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.

#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.

  1. vivekkairi(GitHub profile, opens in a new tab) added labelsvia-triage

  2. tanstack-source added labelsbug

  3. Note

    🤖 Gemini 4 Neon responding on behalf of justcarlson

    Field data supporting the shared --app-data-dir diagnosis:

    On v0.1.12-nightly.20261123.5151 pinned to managed agy 1.5.13, we audited 361 acp-server-*.log files with concurrent Antigravity threads sharing --app-data-dir antigravity-acp and saw 0 CORTEX_STEP_STATUS_CANCELED collisions. We are holding managed agy at 1.5.13 rather than updating to 1.5.17 until this is resolved.

    Suggested direction (judgment, not tested): give each spawned agy acp process its own session state directory (for example antigravity-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.

  4. Confirming this same shared --app-data-dir antigravity-acp collision still reproduces on T3 Code v0.1.13 with Antigravity CLI 1.5.22, and can also manifest as CORTEX_STEP_STATUS_WAITING when 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 on 1.5.22.)

    Environment

    • T3 Code: Desktop & local server 0.1.13 (bc0f04da94f64b5e487c598761a43b4cf06b2ac9)
    • OS: Linux x64
    • Antigravity CLI: 1.5.22 (custom binaryPath), Gemini API key auth, full-access runtime 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 at 16:20:47Z, and Thread B woken by Thread A via t3_thread_send at 16:22:25Z). All acp processes 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-*.log files on startup:
      • 16:20:53Z: server.go:5604] Resuming 3 conversation(s) interrupted by server restart
      • 16: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, step 10337, ran 16:23:57Z–16:24:45.963Z) and a run_command (call_14839931790219470374, queued for step 10338).
      • At 16:24:01.982Z, while step 10337 was blocked in t3_thread_wait, a resumed sibling process overwrote step 10338 with a different run_command (call_8476567604136491500) that never appeared in step 10336, leaving step 10338 in CORTEX_STEP_STATUS_WAITING.
      • When step 10337 completed at 16:24:45.963Z, Thread A's AgentExecutor (agentexecutor.go:444) advanced to step 10338 expecting its own pending tool call and aborted at 16:24:46.511Z with the CORTEX_STEP_STATUS_WAITING error above (step 10339).
    • logs/provider/events.<thread>.log: no session/cancel; session/prompt returned at 16: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.

  5. 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_read and one run_command). Over the next 10 seconds T3 spawned two more agy acp processes 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 live agy acp processes 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 new agy acp process (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 another agy acp process.
    • 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

    1. 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.
    2. 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:13 and 00: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 at 01:01, about 150 restart notices were written across conversations within 10 seconds.

    +1 to landing the per-session --app-data-dir isolation in #43675.


    Triaged with Claude Code (Claude Opus 5.5) running inside T3 Code.

Sign in to join this conversation.