Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: Antigravity ACP collapses earlier assistant replies into "Worked for ..." when background tasks wake the same run #40108

Closedmoredatarequired(GitHub profile, opens in a new tab) opened this issue 7 comments

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 (packages/provider-acp)

Steps to reproduce

  1. Start a thread using the Antigravity provider (ACP, e.g. gemini-4-neon).
  2. In a single run, have the agent launch a long-running background shell command (so it continues running asynchronously), write a substantive user-facing reply/update, and end its turn waiting for the reactive wakeup.
  3. Let the background task finish and wake the agent inside the same T3 Code run, causing the agent to emit a follow-up reply (or multiple wakeups producing assistant:0, assistant:1, ..., assistant:N under the same runId).
  4. Inspect the thread timeline in T3 Code once the run finishes.

Expected behavior

Earlier completed assistant replies produced before background-task wakeups should remain visible in the thread timeline (not silently hidden behind the collapsed Worked for ... group), matching how phase: "final_answer" is preserved for OpenCode (packages/provider-opencode/src/server/v2/adapter.ts:1276-1283) and proposed for Claude in #38562.

Actual behavior

Every earlier assistant_message in the run (assistant:0, assistant:1, ...) is collapsed into Worked for <duration> >, leaving only the final assistant_message (assistant:N) visible in the timeline.

If the final wakeup reply is a brief wrap-up referencing an earlier reply from the same run, the user never sees the substantive earlier update unless they manually expand Worked for ....

Root cause

  • Web (apps/web/src/components/chat/MessagesTimeline.logic.ts:796-804) and mobile (apps/mobile/src/lib/threadActivity.ts) keep an earlier assistant_message visible across continuations only when item.phase === "final_answer":
    if (
      entry.kind === "message" &&
      entry.projectedItem?.item.type === "assistant_message" &&
      entry.projectedItem.item.phase === "final_answer"
    )
      replyEntryIds.add(entry.id);
  • packages/provider-acp/src/server/adapter.ts (lines 3222-3244) emits assistant_message turn_item.updated items without ever setting phase: "final_answer" anywhere in the adapter.
  • By contrast:
    • packages/provider-opencode/src/server/v2/adapter.ts:1276-1283 explicitly promotes the closing assistant text to phase: "final_answer" before a background-work report continues the turn (// A report can land right after the answer; the reply to it must not fold the answer away.).
    • #38562 adds the equivalent phase: "final_answer" tagging for ClaudeAdapterV2.ts.

Impact

Major degradation or frequent failure (any Antigravity run with background-task wakeups hides earlier replies inside Worked for ...).

Version or commit

0.1.12-nightly.20261121.5024

Environment

  • OS: macOS 26.6.2 (darwin/arm64)
  • Provider / Model: Antigravity (antigravity-acp, gemini-4-neon)

Workaround

Instruct the agent to repeat its full, self-contained summary in the final wakeup reply instead of referring to anything written prior to the background task completing.

  • #38562 (same root issue for Claude — preserves phase: "final_answer" across continuations)
  • #8879, #34501, #36116 (related hidden/folded assistant replies)
  • Distinct from #38956 (send_to_user missing rawOutput on Antigravity) and #40032 (Antigravity background-task wakeup permission denials)
  1. tanstack-source added labelsbug

  2. Seeing this on 0.1.12-nightly.20261121.5038 with Antigravity 1.5.14 (gemini-4-neon, desktop + iOS mobile): mid-run replies to steers disappear once later background-task wakes emit another message in the same run. Looking forward to #40559.

  3. Shakabrahh(GitHub profile, opens in a new tab)commented

    Same on Linux, 0.1.12-nightly.20261124.5178, Antigravity / Gemini 4 Neon. Copy also copies only the wake note: #42052.

  4. Confirming this also reproduces on Windows Desktop (T3 Code 0.1.11, Antigravity ACP / gemini-4-neon).

    In a single run (statev2.sqlite), the persisted item sequence was:

    1. assistant_message (~2,352 chars, full main reply, phase: null)
    2. reasoning (triggered after a background task finished)
    3. assistant_message (~204 chars, brief follow-up note, phase: null)

    Because neither assistant message has phase: final_answer, T3 Code collapses the entire 2,352-char main reply under Worked for ... and leaves only the 204-char follow-up visible. Looking forward to #40559 landing.

  5. Confirming live repro on Linux (0.1.12-nightly.20261120.5009, Antigravity ACP / gemini-4-neon): a completed long reply (turn:14:assistant:0) folded into "Worked for ..." and disappeared from the main timeline as soon as a fast async shell task finished 2s later and emitted a 2-line addendum (turn:14:assistant:1) under the same run ordinal. +1 on #40559 — thank you for tracking and putting up a clean fix!

  6. Confirming this also reproduces on macOS Desktop (T3 Code Beta 0.1.11, Antigravity ACP / gemini-4-neon) with async MCP delegate_task completions (not just shell background tasks):

    1. Agent replies in full to a user message (assistant:0, ~3.5K chars) while an async delegate_task is still running.
    2. When the delegated task completes seconds later, Antigravity ACP wakes inside the same runId (no new PreInvocation hook / run boundary) and emits a short follow-up status note (assistant:1).
    3. Because assistant:0 has no phase: "final_answer", the T3 Code timeline folds the entire user-facing reply into Worked for ... and leaves only the short delegate status note visible — making the answer appear to disappear right after the user sees it.

    Temporary agent-side workaround we verified: delivering substantive replies via send_to_user pins them in the timeline so a subsequent assistant:1 wake cannot fold them away. Looking forward to #40559 landing!

  7. Quick correction on the workaround above: send_to_user does not work around this on T3 Code 0.1.11 + Antigravity because of #38956 (Antigravity omits output.sentMessage, so send_to_user also stays hidden inside a collapsed tool call). The only reliable workaround on 0.1.11 until #40559 and #38956 ship is repeating the full user-facing answer in the final plain-text assistant:N response.

  8. Fixed by #47146, now on main: Main now keeps substantive assistant replies visible when an ACP run is continued by background-task wakeups, including when a short housekeeping/wake reply follows; verify by reproducing an Antigravity background command that wakes the same run and checking the earlier reply remains outside Worked for.

  9. juliusmarminge closed this

Sign in to join this conversation.