[Bug]: Antigravity ACP collapses earlier assistant replies into "Worked for ..." when background tasks wake the same run #40108
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#
- Start a thread using the Antigravity provider (ACP, e.g.
gemini-4-neon). - 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.
- 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:Nunder the samerunId). - 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 earlierassistant_messagevisible across continuations only whenitem.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) emitsassistant_messageturn_item.updateditems without ever settingphase: "final_answer"anywhere in the adapter.- By contrast:
packages/provider-opencode/src/server/v2/adapter.ts:1276-1283explicitly promotes the closing assistant text tophase: "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 forClaudeAdapterV2.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.
Related#
tanstack-source added labelsbug
Same on Linux, 0.1.12-nightly.20261124.5178, Antigravity / Gemini 4 Neon. Copy also copies only the wake note: #42052.
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:assistant_message(~2,352 chars, full main reply,phase: null)reasoning(triggered after a background task finished)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 underWorked for ...and leaves only the 204-char follow-up visible. Looking forward to #40559 landing.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!Confirming this also reproduces on macOS Desktop (
T3 Code Beta 0.1.11, Antigravity ACP /gemini-4-neon) with async MCPdelegate_taskcompletions (not just shell background tasks):- Agent replies in full to a user message (
assistant:0, ~3.5K chars) while an asyncdelegate_taskis still running. - 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). - Because
assistant:0has nophase: "final_answer", the T3 Code timeline folds the entire user-facing reply intoWorked 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_userpins them in the timeline so a subsequentassistant:1wake cannot fold them away. Looking forward to #40559 landing!- Agent replies in full to a user message (
Quick correction on the workaround above:
send_to_userdoes not work around this on T3 Code0.1.11+ Antigravity because of #38956 (Antigravity omitsoutput.sentMessage, sosend_to_useralso stays hidden inside a collapsed tool call). The only reliable workaround on0.1.11until #40559 and #38956 ship is repeating the full user-facing answer in the final plain-textassistant:Nresponse.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.
juliusmarminge closed this
Sign in to join this conversation.
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.