[Bug]: Antigravity/Gemini randomly hangs in thinking, then session/cancel fails and the thread cannot recover#14619

openedOct 1, 2026byHheykerim

Before submitting

  • I searched existing issues and did not find an exact duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server + apps/desktop (Antigravity / ACP session lifecycle)

Summary

Antigravity/Gemini sessions in T3 Code intermittently get stuck in a running/thinking state even though the agent has stopped making progress. The elapsed timer keeps increasing and the thread still looks active, but no further output or tool activity arrives.

When I try to stop the stuck run, T3 Code often surfaces:

1ACP transport operation call-rpc failed for method session/cancel.

and/or:

1The request was canceled by the client.

After that, the thread may remain in a bad/stuck state instead of cleanly settling or recovering.

This has been happening repeatedly for roughly two weeks and, in my usage, only with the Antigravity/Gemini provider. I have not seen the same behavior with the other providers I use in T3 Code.

Steps to reproduce

This is intermittent rather than perfectly deterministic, but it happens frequently enough to block normal use:

  1. Open a T3 Code thread using the Antigravity provider.
  2. Select a Gemini model (currently observed with Gemini 3.8 Flash (High)).
  3. Run a normal coding task, especially one that takes several minutes and uses tools.
  4. At some point the agent stops producing output/activity, but T3 Code continues showing the turn as running/thinking and the elapsed timer keeps increasing.
  5. Wait several more minutes; the session does not recover.
  6. Click Stop / cancel the run.
  7. T3 Code reports:
    1ACP transport operation call-rpc failed for method session/cancel.
    In the affected run shown in my screenshot, the UI also showed:
    1The request was canceled by the client.
  8. The thread does not reliably return to a clean idle state.

A recent occurrence ran for 11m 39s before I stopped it and got the session/cancel transport error.

Expected behavior

  • If the Antigravity/Gemini stream stops or the provider session becomes unhealthy, T3 Code should either reconnect/recover or clearly fail the turn.
  • Clicking Stop should always settle the current turn cleanly as cancelled.
  • session/cancel transport failures should not leave the thread appearing active or unusable.
  • The UI should never remain indefinitely in a thinking/running state when the provider has stopped making progress.

Actual behavior

  • The thread randomly stops progressing while still appearing to run.
  • The timer continues indefinitely.
  • The agent produces no further output/tool activity.
  • Cancelling can fail with:
    1ACP transport operation call-rpc failed for method session/cancel.
  • The thread can remain stuck instead of cleanly settling/recovering.

Impact

Blocks work completely for Gemini inside T3 Code.

I currently have to use Google Antigravity directly when I want to use Gemini because T3 Code is not reliable enough for these sessions.

Version or commit

T3 Code (Nightly) 0.0.43-nightly.20260929.2450 (27bdf1aa14e6)

This is the exact build from the latest reproduced occurrence shown in the attached screenshot.

The problem has been recurring for approximately two weeks across multiple Gemini sessions.

Environment

  • macOS
  • T3 Code desktop app
  • Provider: Antigravity
  • Model observed in latest occurrence: Gemini 3.8 Flash (High)

Logs or stack traces

Most visible error from the affected run:

shell
1ACP transport operation call-rpc failed for method session/cancel.

The UI also reported:

shell
1The request was canceled by the client.

I can provide the corresponding server.trace.ndjson / provider event logs if maintainers tell me which thread/session identifiers are most useful.

This looks closely related to PR #11626:

https://github.com/pingdotgg/t3code/pull/11626

That PR explicitly described and attempted to fix the same user-facing error:

1ACP transport operation call-rpc failed for method session/cancel.

It also described Antigravity prompt cancellation failures and a short cancel timeout, but the PR was closed without being merged.

There is also #11670, which covers Antigravity ACP stream drops / failed recovery:

https://github.com/pingdotgg/t3code/issues/11670

My report may share part of that lifecycle/recovery path, but the visible failure here is specifically a turn that remains stuck as running and then fails on session/cancel. I am not assuming the root cause is identical without the trace logs.

Workaround

Use Antigravity directly instead of T3 Code for Gemini sessions.

Note

Grok responding on behalf of Julius.

Triage

Thanks for the report, @heykerim. This is a real bug, and it's still present on main (5cc99e1c23). It isn't a duplicate of #11670 (open issue). In that issue the Antigravity stream dies with a raw EOF. Here the thread sits in thinking with no error until you press Stop, and then Stop fails. You don't need to look up your version, because this code path hasn't changed since your build.

What's happening

An Antigravity turn has no progress timeout. The session stays running as long as session/prompt is open, so if Gemini stops sending updates and never finishes that call, the timer keeps counting until you click Stop.

Stop for Antigravity sends session/cancel and then waits up to 15 seconds for the prompt to finish (cancelBehavior: "wait-for-prompt"):

https://github.com/pingdotgg/t3code/blob/5cc99e1c23980d7995a13c47f969b47cb68ed1be/apps/server/src/provider/acp/AntigravityAcpSupport.ts#L67

https://github.com/pingdotgg/t3code/blob/5cc99e1c23980d7995a13c47f969b47cb68ed1be/apps/server/src/provider/acp/AcpSessionRuntime.ts#L968-L1004

session/cancel is a notification, not a request, so the error you saw doesn't come from the cancel itself. If the prompt doesn't finish within 15 seconds, T3 kills the agent process and raises a made-up AcpTransportError for session/cancel. Its message leaves out the useful detail ("The ACP agent did not finish cancellation. Its process was stopped."), so all you see is ACP transport operation call-rpc failed for method session/cancel.:

https://github.com/pingdotgg/t3code/blob/5cc99e1c23980d7995a13c47f969b47cb68ed1be/packages/effect-acp/src/errors.ts#L173-L177

The other message, "The request was canceled by the client.", is the open session/prompt coming back after the cancel. Instead of treating it as a normal cancellation, interruptTurn passes it on as a session/cancel failure, so the turn is never marked as cancelled:

https://github.com/pingdotgg/t3code/blob/5cc99e1c23980d7995a13c47f969b47cb68ed1be/apps/server/src/provider/Layers/AntigravityAdapter.ts#L1136-L1188

Because the process gets killed, the runtime stays in a failed state, and the next prompt runs into the same unrecoverable session as #11670.

What's upstream and what's ours

The agent going silent and not finishing the cancel quickly is upstream, in agy and Gemini. T3 owns the rest: there's no stall timeout while a prompt is open, cancel errors show up as a transport failure, and Stop doesn't mark the turn as cancelled. #11626 (closed PR, not merged) targeted these same error strings. It also raised the cancel wait from 15 seconds to 60, which is a product decision.

Proposed fix

  1. When the prompt fails because a cancel was requested ("The request was canceled by the client." or a context-canceled error), complete the turn as cancelled instead of reporting a session/cancel transport error.
  2. When the 15-second wait runs out, still stop the process, but mark the turn as cancelled, and if an error is shown at all, show the real detail.
  3. Keep the 15-second default unless maintainers agree to change it.

A trace is optional. If you still have the run, the useful part is from the last session/update to the moment you clicked Stop: the thread id, when you clicked Stop, and whether a process exit follows the cancel.

Synced from GitHub

Note

Antigravity responding on behalf of @GorlikItsMe.

Adding the deterministic repro notes and trace details as requested from #14854:

Deterministic Reproduction: Active Background Task + Queued User Message

While this issue also occurs intermittently during long "thinking" turns, we found a 100% reproducible trigger involving background tasks:

  1. Background task started: During a turn, the agent runs a persistent service (e.g. bun run dev / npm run dev), which the Antigravity harness tracks as a running background command task.
  2. Text generation finishes: The assistant streams its complete answer text to the UI.
  3. Turn remains open on backend: Even though no more text or tool calls are pending, the session/prompt call never completes because the background process is alive and occasionally emitting activity updates (tool.updated). In our logs, AntigravityAdapter.sendTurn remained active for 462,564 ms (~7.7 minutes).
  4. User queues a follow-up message: Seeing the response on screen while the composer shows the turn still running, the user submits a new prompt. The message enters the queue.
  5. Preempting the turn triggers session/cancel: T3 Code picks up the queued message, dispatches thread.turn-start-requested, and calls interruptTurn -> session/cancel.
  6. 15s cancel timeout expires: Because Antigravity uses cancelBehavior: "wait-for-prompt", T3 Code awaits activePrompt.value.fiber with defaultCancelTimeout (15s). With the background task still attached, Antigravity doesn't exit the prompt fiber within 15s.
  7. Fatal session crash: At 15,019 ms, timeoutOption raises AcpTransportError, invokes retireRuntime, and stops the session (status: "stopped" / session.exited).

Relevant Log Traces

From server.trace.ndjson:

json
1{"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."}}

Timeline from SQLite orchestration_events & provider event stream:

118:05:22.312Z Assistant finished streaming final response text
218:06:22.608Z Background task activity update received (bun run dev status: inProgress)
318:10:03.255Z User submits new message -> queued -> thread.turn-start-requested -> interruptTurn called
418:10:03.255Z T3 Code invokes session/cancel (cancelBehavior: "wait-for-prompt", timeout: 15s)
518:10:18.287Z (+15,032 ms) cancel timeout hit -> AcpTransportError: "The ACP agent did not finish cancellation. Its process was stopped."
618:10:18.307Z session/prompt fails with errorTag: "Interrupt" ("The request was canceled by the client.")
718:10:18.349Z session.exited emitted (exitKind: "error", reason: "Antigravity process stopped.")

This confirms the proposed fix in triage: handling cancel timeouts / prompt interrupts without retiring the entire adapter runtime will completely prevent this crash.

Synced from GitHub

Adding Windows diagnostic evidence from T3 Code Desktop 0.0.45, Antigravity ACP 1.1.1, and gemini-3.8-flash-high, based on SQLite events, provider logs, and server.trace.ndjson.

Thread: d1c68c22

Timeline (October 10, 2026, UTC)

  • 13:38:55.824Z: Two background bash tasks started during an earlier turn.
  • 13:41:11.933Z: Incident B (background-task hang): Turn a709e65a started and remained running for over an hour without new assistant output.
  • 14:50:53.510Z: A follow-up prompt triggered session/cancel.
  • 14:51:08.524Z: The 15-second cancellation watchdog expired, triggering AcpSessionRuntime.retireRuntime.
  • 14:51:08.644Z: The affected turn entered state: "error".
  • 14:51:58.960Z: A subsequent turn completed successfully on a new ACP runtime without restarting T3 Code.
  • 16:33:50.432Z: Incident A (mid-stream stall): Turn eb220536 stopped generating text mid-sentence.
  • 16:33:50.432Zโ€“17:15:30.853Z: No further provider updates for 41m 40s, despite the T3 server remaining responsive. No active background commands were identified during this stall.
  • 17:15:30.853Z: User manually interrupted the turn.
  • 17:15:45.869Z: The cancellation watchdog expired, and AcpSessionRuntime.retireRuntime executed.
  • 17:15:45.878Z: Provider logs recorded session/prompt failing with errorTag: "Interrupt", followed by session.exited.
  • 17:15:45.886Z: The database recorded state: "interrupted" with completed_at: "17:15:30.855Z", approximately 15 seconds before the watchdog expired.
  • 17:16:35.009Zโ€“17:16:38.232Z: A new ACP runtime successfully executed session/resume in approximately 3.22 seconds.
  • 17:16:54.243Z: The subsequent turn completed successfully without restarting T3 Code.

These findings add two details to the existing triage:

  1. Mid-stream generation can stall without an identified active background command, suggesting a scenario distinct from the previously reported background-task hang.
  2. Cancellation timeouts surface transport errors and leave affected turns in interrupted or error states, but do not necessarily prevent subsequent prompts from succeeding.

Note

๐Ÿค– Claude Opus 5.5 responding on behalf of Theo

Thanks for the report. This fault is outside T3 Code, so we cannot fix it here. Please report it to the project that owns that tool. If you find a fault in T3 Code itself, please open a new issue with steps to reproduce it.

Synced from GitHub

Following up on the request above for traces, identifiers, the runtime version, and whether it still happens on current code. I hit this in my own install and then reproduced it on current main in an isolated dev instance. Short version: it still happens on main at 6f75bcb374, and it reproduced on the first attempt with a simple trigger, and once a thread has hit it, later turns in the same thread stall too.

Environment

  • macOS arm64, Antigravity ACP runtime 1.3.0 (the managed release whose SHA-256 is pinned in antigravityRelease.ts), model gemini-4-argon-high, Google account sign-in.
  • Original incident: my installed build, a localized 0.1.1-zh.2 based on v0.1.1. Its patches change web/desktop display strings and layout, plus one server change to the Antigravity quota request User-Agent (antigravityUsageLimits.ts). None of them touch packages/effect-acp, packages/provider-acp, or the Antigravity adapter's turn, cancel, or process lifecycle.
  • Reproduction: unmodified main at 6f75bcb374 (2026-10-21), vp run dev in a separate worktree with its own --home-dir, so nightly-equivalent code.

Reproduction on main

All times UTC, 2026-10-22. Thread IDs are from the isolated dev instance.

Test A, thread 4cacdc2e-5221-42e6-b81f-b93f1b040a74. Prompt: "Start a local static file server in this repo with python3 -m http.server 18765 as a long-running background process. Do not wait for it to exit and do not stop it. Once it is listening, reply with exactly: SERVER STARTED"

TimeEvent
04:59:00.479session/prompt started
04:59:06.076command item started (the server process)
04:59:20.344assistant message SERVER STARTED streamed; no further updates after this
05:04:25.700Stop (EnvironmentCommands.interruptThreadTurn โ†’ Orchestrator.dispatchRunInterrupt)
05:04:25.722AcpAdapterV2.interruptTurn starts; ends after 15026 ms with Failure (ProviderAdapterInterruptError: Failed to interrupt antigravity provider turn โ€ฆ)
05:04:40.726AcpSessionRuntime.retireRuntime
05:04:40.755session/prompt failed, errorTag: "AcpProcessExitedError"; command item marked interrupted

So the answer was complete about 20 seconds in, but the turn stayed running for 5 minutes until Stop, and Stop took the full 15-second cancel window.

Same thread, next turn. Prompt: "Reply with exactly: RECOVERED". Before sending it, I manually killed the leftover server process (see "Leftover child process" below).

TimeEvent
05:05:08โ€“05:05:13new runtime: session/new, session/load, session/set_config_option all succeeded
05:05:13.301session/prompt started
05:05:19.632assistant message RECOVERED streamed
05:05:19 โ†’ 05:12:21no further updates; the turn kept running for 7 minutes
05:12:21.474Stop
05:12:21.496AcpAdapterV2.interruptTurn ends after 15018 ms with Failure
05:12:36.497retireRuntime
05:12:36.521session/prompt failed, AcpProcessExitedError

At 05:12:11, mid-stall, agy_acp_server.par used 0% CPU. Its only non-loopback socket was a CLOSE_WAIT connection to daily-cloudcode-pa.googleapis.com:443, and the two localharness_external children had only loopback sockets.

Controls, same instance and project:

  • New thread 1f869fe4-2a69-4424-9e97-ad6ded9c5bb7, "Reply with exactly: CONTROL OK": session/prompt started 05:12:56.365, succeeded 05:13:00.788.
  • Test B, new thread 695a9974-b72f-4eee-8b3c-787a19a999e9, the server started fully detached with nohup python3 -m http.server 18766 >/dev/null 2>&1 &: session/prompt started 05:13:21.844, succeeded 05:13:34.083.

So the stall needs a command that the agent is still tracking as running (Test A). A detached process (Test B) does not trigger it. Once a thread has stalled this way, the restored session (session/load) stalls the following turns too, even after the process is gone. This matches the background-task trigger @GorlikItsMe described above, and adds the "stays stuck after reload" part.

Original incident (installed 0.1.1-zh.2)

Thread 324c2731-5f27-414e-a487-13c87da327b6. Its first 3 prompts succeeded. The 4th turn was the first to leave two native tool calls that never completed, and from then on 26 consecutive prompts never returned: each one ended only when Stop or a queued follow-up message forced a runtime restart (AcpProcessExitedError). One of those turns sat for about 7 hours before I stopped it. Across 24 Antigravity threads on this machine (101 prompts, 75 succeeded), this is the only thread with never-completed tool calls, and it accounts for all 26 failures.

Latest incident, from server.trace.ndjson and the provider event log:

TimeEvent
04:10:06.984session/prompt started (fresh runtime after session/load)
04:12:59last assistant update; nothing afterwards
04:17 (sampled)agy_acp_server.par at 0% CPU; only non-loopback socket CLOSE_WAIT to daily-cloudcode-pa.googleapis.com:443; harness children loopback only
04:24:26.840Stop dispatched (run.interrupt)
04:24:26.931AcpAdapterV2.interruptTurn ends after 15027 ms with Failure
04:24:42.039session/prompt failed, AcpProcessExitedError; turn finalized as interrupted

Leftover child process

In Test A, after retireRuntime killed the ACP process, the python3 -m http.server it had started kept running, reparented to PID 1 in its own process group and still listening on its port. I had to kill it by hand. This seems to be a separate problem (process cleanup on Stop), but it has the same trigger. I'm happy to file it separately if that's preferred.

Notes

  • The ACP runtime's stderr is dropped (packages/effect-acp/src/_internal/stdio.ts, stderr: () => Sink.drain), so there is no runtime-side log of what it was waiting on.
  • I haven't tested #21439 against this repro.
  • The exact prompts above should reproduce this on any machine with an Antigravity account. I have the full provider event logs and trace excerpts locally and can share more on request.

Note

๐Ÿค– Claude Opus 5.5 responding on behalf of Theo

Reopening: our earlier "upstream" close was wrong for part of this. A reporter reproduced it on current main: the thread does not recover after a failed Stop, and the process the agent started keeps running after Stop. #21439 targets the recovery part.