[Bug]: Antigravity session crashes with 'ACP transport operation call-rpc failed for method session/cancel' when queuing a message #14854
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area#
apps/server
Steps to reproduce#
- In T3 Code desktop, start a session using the Antigravity provider.
- In a turn, execute a command that starts a continuous background server/process (e.g.
bun run devornpm run dev), which gets captured as a running background task. - The assistant finishes generating its text response.
- Notice that the turn/prompt remains active on the backend (duration keeps growing, e.g. awaiting background task events or I/O drain).
- Send a new prompt from the UI while the previous turn is in this state (the message is queued and then triggers
thread.turn-start-requested). AntigravityAdapter.sendTurnattempts to interrupt/cancel the active turn by invokingsession/cancel.
Expected behavior#
The active turn should be cleanly and promptly cancelled, or interrupted without throwing a fatal transport exception. The queued user message should then proceed to start a new turn normally.
Actual behavior#
The entire session crashes with:
ACP transport operation call-rpc failed for method session/cancel.
The session transitions into status: "error" and then status: "stopped", and the turn cannot be started without reinitializing the thread.
Root Cause Analysis#
In apps/server:
AntigravityAdapterinitializes its ACP runtime withcancelBehavior: "wait-for-prompt":cancelBehavior: "wait-for-prompt"- In
AcpSessionRuntime:const defaultCancelTimeout = seconds(15); // ... if (options.cancelBehavior !== "wait-for-prompt") { if (isSome(activePrompt)) yield* interrupt$1(activePrompt.value.fiber).pipe(ignore$1); yield* acp.agent.cancel({ sessionId: started.sessionId }).pipe(ignore$1); return; } yield* acp.agent.cancel({ sessionId: started.sessionId }); if (isNone(activePrompt)) return; const completed = yield* gen$1(function* () { const result = yield* await_(activePrompt.value.fiber); yield* _await(activePrompt.value.completed); if (isNone(yield* get$6(terminationErrorRef))) yield* drainEvents; return result; }).pipe(timeoutOption(options.cancelTimeout ?? defaultCancelTimeout)); if (isNone(completed)) { const error = new AcpTransportError({ operation: "call-rpc", method: "session/cancel", detail: "The ACP agent did not finish cancellation. Its process was stopped.", cause: void 0 }); yield* retireRuntime(error); return yield* error; } - Because
cancelBehavioris"wait-for-prompt", T3 Code synchronously waits up to 15 seconds (defaultCancelTimeout) foractivePrompt.value.fiberto complete. - When a long-running background command was started during the turn, the Antigravity backend agent does not complete or acknowledge cancellation within 15 seconds.
- After exactly 15,019 ms,
timeoutOptionreturns None, creating anAcpTransportError, callingretireRuntime(error), and stopping the session.
Suggested fixes:
- Consider allowing a shorter non-blocking interrupt for Antigravity, or fallback to forced fiber interruption instead of hard-failing
retireRuntimewhen cancellation times out. - Alternatively, handle timeout during
session/cancelgracefully without invalidating the entire adapter session runtime.
Impact#
Major degradation or frequent failure
Version or commit#
0.0.45-nightly.20261002.2584 (commit 54084ae1e6c3)
Environment#
Linux (x86_64), T3 Code Desktop AppImage (v0.0.45-nightly.20261002.2584), Antigravity ACP provider (agy_acp_server.par), Bun 1.2
Logs or stack traces#
ProviderAdapterRequestError: ACP transport operation call-rpc failed for method session/cancel.
AcpTransportError: ACP transport operation call-rpc failed for method session/cancel.
detail: "The ACP agent did not finish cancellation. Its process was stopped."
From server.trace.ndjson:
{"level":40,"time":1759428618287,"pid":486518,"name":"AntigravityAdapter.sendTurn","durationMs":462564.6,"threadId":"c285cbba-ab4d-45f0-8123-ae9debb8d315","error":{"name":"ProviderAdapterRequestError","provider":"antigravity","method":"session/cancel","detail":"ACP transport operation call-rpc failed for method session/cancel."}}
From state.sqlite (orchestration_events):
--- thread.session-set 2026-10-02T18:10:03.255Z
{"threadId":"c285cbba-ab4d-45f0-8123-ae9debb8d315","session":{"status":"error","providerName":"antigravity","lastError":"ACP transport operation call-rpc failed for method session/cancel."}}
--- thread.activity-appended 2026-10-02T18:10:03.255Z
{"summary":"Provider turn start failed","payload":{"detail":"ACP transport operation call-rpc failed for method session/cancel."}}
--- thread.session-set 2026-10-02T18:10:18.349Z
{"status":"stopped","lastError":"ACP transport operation call-rpc failed for method session/cancel."}
Workaround#
Avoid launching continuous dev servers via assistant run_command in the thread, or manually terminate the background task before sending subsequent prompts.
juliusmarminge added labelsduplicate
juliusmarminge closed this
Sign in to join this conversation.
Note
Grok responding on behalf of Julius.
Closing as a duplicate of #14619.
Same failure mode: Antigravity uses
cancelBehavior: "wait-for-prompt", waits up to 15s for the active prompt fiber, then raisesAcpTransportErrorforsession/canceland retires the runtime. #14619 already has triage covering that path (and the proposed fix: treat cancel-timeout / "canceled by the client" as a clean cancelled turn instead of a fatal transport error).Your background
bun run dev/ queued-message steps are a solid deterministic repro of that same cancel timeout — useful detail, but not a separate bug. Please add any extra logs or repro notes on #14619.