Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: Antigravity session crashes with 'ACP transport operation call-rpc failed for method session/cancel' when queuing a message #14854

ClosedGorlikItsMe(GitHub profile, opens in a new tab) opened this issue 1 comment

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

  1. In T3 Code desktop, start a session using the Antigravity provider.
  2. In a turn, execute a command that starts a continuous background server/process (e.g. bun run dev or npm run dev), which gets captured as a running background task.
  3. The assistant finishes generating its text response.
  4. Notice that the turn/prompt remains active on the backend (duration keeps growing, e.g. awaiting background task events or I/O drain).
  5. 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).
  6. AntigravityAdapter.sendTurn attempts to interrupt/cancel the active turn by invoking session/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:

  1. AntigravityAdapter initializes its ACP runtime with cancelBehavior: "wait-for-prompt":
    cancelBehavior: "wait-for-prompt"
  2. 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;
    }
  3. Because cancelBehavior is "wait-for-prompt", T3 Code synchronously waits up to 15 seconds (defaultCancelTimeout) for activePrompt.value.fiber to complete.
  4. When a long-running background command was started during the turn, the Antigravity backend agent does not complete or acknowledge cancellation within 15 seconds.
  5. After exactly 15,019 ms, timeoutOption returns None, creating an AcpTransportError, calling retireRuntime(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 retireRuntime when cancellation times out.
  • Alternatively, handle timeout during session/cancel gracefully 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.

  1. 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 raises AcpTransportError for session/cancel and 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.

  2. juliusmarminge added labelsduplicate

  3. juliusmarminge closed this

Sign in to join this conversation.