t3code icon indicating copy to clipboard operation
t3code copied to clipboard

[Bug]: Antigravity turn stalls mid-response with "Thinking" / spinner indefinitely

Open itskodaaa opened this issue 3 weeks ago • 3 comments

Summary

In an Antigravity (gemini-3.8-flash) session, the assistant finished generating its full response in the backend, but streaming stalled mid-response in the UI. The turn remained stuck indefinitely in a "Thinking" state with the spinner and Stop button active.

Evidence

T3 Code stuck in Thinking state

Observed Details

  1. Backend finished: In the backend conversation log (transcript.jsonl), the step completed with status DONE (133 tokens generated).
  2. UI state stuck: In statev2.sqlite, orchestration_v2_projection_turn_items remained stuck with status: "running" and streaming: true, truncated right at the first text chunk.
  3. Bridge deadlock: session/prompt has no timeout in T3 Code. The underlying agy_acp_server prompt handler hung waiting for an IDLE_SENTINEL / is_idle event from the localharness WebSocket, so it never emitted the terminal JSON-RPC PromptResponse(stop_reason="end_turn").
  4. Environment: T3 Code (Beta), macOS (Apple Silicon), Provider: Antigravity (gemini-3.8-flash).

itskodaaa avatar Nov 04 '26 14:11 itskodaaa

Can also confirm this exact behavior on Linux x86_64 (Arch / Omarchy).

Environment Details

  • OS: Linux 7.2.15-1-omarchy (Arch-based), x86_64
  • T3 Code Version: Beta 0.1.7 (Electron 44.10.1 / Chromium 152)
  • Model: gemini-3.8-flash via Antigravity harness
  • Antigravity ACP Server: linux-x64/versions/923923a0d7dc8073f66cc6f78647a3107e3a7ee2b7e1a24df8b3927b5188013b/agy_acp_server.par

Observed Logs & Telemetry

  1. Backend Transcript: In transcript.jsonl, the step finishes with status: "DONE" and all tokens are generated cleanly.
  2. ACP Event Log: In ~/.t3/userdata/logs/provider/events.<threadId>.log, the session/prompt method starts ("status": "started"), but never receives the terminal "status": "succeeded" event:
    {"method":"session/prompt","status":"started","request":{"valueType":"object","fieldCount":2}}
    
  3. Deadlock / Stop behavior: The UI remains stuck in the "Thinking" state until pressing the red Stop button. Pressing Stop forces an interruption across the Effect fibers in server.trace.ndjson:
    EffectOutbox.signalCancellations
    InterruptError: All fibers interrupted without error
    
    Once interrupted, the thread finally unlocks into Done with the full generated response already present in the view.

Confirming that this is cross-platform and directly linked to agy_acp_server not dispatching the terminal prompt response / end-of-turn signal when running without tools or after completion.

davidavasalcai avatar Nov 07 '26 13:11 davidavasalcai

Additional Reproduction & Root-Cause Confirmation (macOS Apple Silicon)

Encountered this exact stall in thread 19efa2c5-41dd-4373-9111-4a58f307cd63. Importantly, to clarify the symptom: the model actually finishes generating its response completely on the backend—it is not stalled mid-generation, but hangs right when completing the turn because the end-of-turn signal never dispatches.

Environment

  • OS: macOS 27.0.0 (darwin arm64)
  • T3 Code: 0.1.8-nightly.20261107.4301 (Electron 44.10.1 / Chromium 152 / Node v24.22.1)
  • Provider / Model: Antigravity (gemini-3.8-flash)
  • Binary: agy_acp_server.par (darwin-arm64/versions/f9bdd68291ae78c38d2141e63bc86b84e6cc7b9f60f71652c68435a7943deb17)

Verified Source Call Path & Deadlock Trace

Inspecting the Python runtime within agy_acp_server.par reveals the exact blocking point:

  1. In agent_acp_server.prompt(), the prompt lifecycle is driven by draining the step stream:
    async for step in agent.conversation.receive_steps():
        await self._stream_live_step(...)
    
  2. In LocalConnection.receive_steps(), the loop awaits steps from self._processor.step_queue:
    while True:
        if self.is_idle and self._processor.step_queue.empty():
            return
        step_obj = await self._processor.step_queue.get()
        if step_obj is event_processor.IDLE_SENTINEL:
            continue
        yield step_obj
    
  3. In LocalHarnessEventProcessor.process_event(), self.is_idle.set() and self.step_queue.put(IDLE_SENTINEL) are only executed when a trajectory_state_update with State.STATE_FULLY_IDLE is received for self.main_trajectory_id.
  4. When localharness_external does not emit STATE_FULLY_IDLE for the main trajectory after the final planner step:
    • IDLE_SENTINEL is never enqueued into step_queue.
    • receive_steps() hangs indefinitely at await self._processor.step_queue.get(). Process sampling of agy_acp_server.par confirms the reader thread remains parked on _queue_SimpleQueue_get / _pthread_cond_wait.
    • prompt() never completes, so the terminal JSON-RPC PromptResponse(stopReason="end_turn") is never sent across stdio to T3 Code.
  5. In T3 Code's server (AcpSessionRuntime.ts), session/prompt has no client-side inactivity watchdog, so the turn remains in status: "running" with the UI spinner active until the user clicks "Stop" (which triggers cancellation via EffectOutbox.signalCancellations).

Telemetry Evidence

  • Backend Transcript: In transcript.jsonl, step 497 has type: "PLANNER_RESPONSE", status: "DONE", and generated all 541 output tokens cleanly.
  • Provider Event Log (events.<threadId>.log): session/prompt starts ("status": "started"), but never logs "status": "succeeded" or "status": "failed".
  • Database (statev2.sqlite): In orchestration_v2_projection_turn_items, the assistant_message record remains in status: "running" with streaming: true and completedAt: null.

Reported via t3 triage with gemini-3.8-flash (Antigravity harness).

PrpCena avatar Nov 08 '26 20:11 PrpCena

This is the same problem as #30271, so I'm closing it in favour of that one. If it is different, say how and it will be reopened.

juliusmarminge avatar Nov 12 '26 06:11 juliusmarminge