Repository navigation
Description
When an Antigravity agent leaves a non-daemon run_command process alive from an earlier step and then finishes its final reply, T3 Code keeps the turn stuck in running forever. The UI shows a completed assistant message above an active red Stop button with no background-work indicator, so the thread looks like stuck text streaming. Steering the thread to finish causes the model to write a second complete reply that also stays stuck in running. When this happens inside a delegated child thread from delegate_task, the child finishes its answer while the parent thread waits forever and never receives the result.
I hit this on 0.1.11-nightly.20261119.4954 with managed antigravity 1.5.13 in a delegated review thread. Early in the run, the child executed a shell loop over filenames containing spaces without quoting, which passed - to ffprobe and left ffprobe blocked on stdin. The agent noticed the bug from the task log, ran a fixed command in a later step, completed its full analysis, and wrote its final review. The ACP event log confirmed session/prompt returned succeeded. Later I steered the child thread asking it to finish. The agent wrote a complete second review and session/prompt returned succeeded again, yet the thread stayed in running and the parent thread stayed in waiting indefinitely with the child still listed in pendingBackgroundTasks.
Tracing apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.ts, apps/server/src/provider/acp/AntigravityProtocol.ts, packages/provider-acp/src/server/adapter.ts, packages/shared/src/orchestrationV2PendingBackgroundWork.ts, and apps/web/src/components/ChatView.logic.ts on main at commit ccc1feb155 shows four defects that create this deadlock.
First, AntigravityAdapterV2 at lines 241 to 245 enables deferFinalizeForBackgroundWork: true and toolOutlivesPrompt: antigravityToolOutlivesPrompt. In AntigravityProtocol.ts at lines 55 to 59, antigravityToolOutlivesPrompt returns true for every non-daemon execute tool call, even when the agent moved past that command many steps earlier and never asked to wait on it. When session/prompt resolves in packages/provider-acp/src/server/adapter.ts at lines 9075 to 9086, hasDeferredBackgroundWork at lines 4199 to 4207 sees the old execute tool still in status === "running", runs closeTextStreams(context), and returns early without calling finalizeTurn. By contrast, backgroundWorkKindHoldsCompletion in packages/shared/src/orchestrationV2PendingBackgroundWork.ts at lines 110 to 120 avoids holding completion for generic commands unless the agent marks them awaited, and adapter.ts at lines 4212 to 4213 skips context.backgroundCommands for other ACP providers for the same reason.
Second, the UI hides the held command. Because the run never leaves running, derivePendingBackgroundWork in packages/shared/src/orchestrationV2PendingBackgroundWork.ts at lines 271 to 279 returns an empty list whenever hasActiveRun is true. In apps/web/src/components/ChatView.logic.ts at lines 1585 to 1620, deriveThreadPendingBackgroundTasks also filters out every turn item whose runId belongs to liveRunIds. The thread reports pendingBackgroundTasks: [] and renders no background-work status bar or running command badge. A user looking at the thread sees only a finished message and an active Stop button, with no clue that a background shell command from earlier in the run is blocking settlement.
Third, steering cannot break the hold and the watchdog never fires. Because AntigravityAdapterV2 sets steersWithPrompt: antigravitySteersWithPrompt at line 250, a steer dispatches a new session/prompt inside the same ActiveAcpTurn. The agent writes another complete reply, session/prompt succeeds, and hasDeferredBackgroundWork still sees the old running tool in context.tools and skips finalizeTurn again. promptInactivityPaused in adapter.ts at lines 8698 to 8711 returns true whenever any tool in context.tools has status === "running", so the inactivity watchdog stays paused forever. PR #39450 covers only background commands canceled via manage_task, where the SQLite step status changes to canceled. Here the OS process is still alive and blocked on stdin, so the step remains running in Antigravity too.
Fourth, delegated orchestration deadlocks silently. Because the child run never reaches completed, T3 Code never delivers the child's final answer to the parent thread. The parent thread sits in waiting forever even though the child finished its review and is doing no foreground work.
A complete, state-of-the-art fix should solve the lifecycle, UI visibility, and parent-child delivery contract together instead of treating every running execute tool call as an indefinite silent hold:
- Show held background tools clearly in the UI and thread state. Whenever
promptSettledistrueand a run stays open only becausehasDeferredBackgroundWorkmatched running tools, expose those tools in the thread's background-work panel with the command summary, elapsed time, and direct actions to inspect output, kill the background command, or finalize the turn. Never leave the UI showing a finished message, an active Stop button, and an emptypendingBackgroundTaskslist. - Distinguish awaited background work from abandoned commands. Align Antigravity with
backgroundWorkKindHoldsCompletioninpackages/shared/src/orchestrationV2PendingBackgroundWork.ts. Keep the run held only for work the agent is waiting on, such as aschedulewake, an explicitly awaited task, or a background command started in the final planner step where the agent paused to wait for its completion wakeup. If a background command started in an earlier planner step and the agent continued through later steps and emitted a complete final answer withsession/promptsucceeding, settle the run cleanly while tracking the still-running command inpendingBackgroundTasksso the user can see or stop it and any late wakeup can still attach. - Prevent delegated parent-child deadlocks. When a
delegate_taskchild finishes its final reply andsession/promptresolves with no foreground work or explicit wait pending, settle the child run and deliver its answer to the parent thread instead of holding the parent inwaitingforever on an orphaned shell process. Clean up or clearly report any orphaned child shell processes on child completion. - Bound silent post-prompt holds and make steers aware of held tools. Do not let
promptInactivityPausedsuppress all staleness detection forever afterpromptSettledistruewhen a held tool produces zero output for a long period. If the user steers a thread held open only by an older running tool, show the held command clearly and re-evaluate settlement instead of repeating the same unfinalized hold after the steered prompt succeeds. - Add automated tests across the adapter, projection, and web UI layers. Cover an Antigravity turn that backgrounds a command in an earlier step, runs later steps, and finishes its reply while that earlier command stays
runningand silent. Verify that the UI displays the running background work instead of an empty pending list, that steering settles cleanly, and that a delegated child delivers its completed reply to its parent thread without deadlocking.
Activity
fcakyon commentedon Nov 21, 2026
Another reproduction on nightly with managed agy 1.5.13, this time from an autonomous wake run and with the root cause traced on the command side.
session/promptsettled withend_turnat 12:50:48Z. Background task wakes kept the same T3 run busy from 12:51:12Z.gemini-flash-worker-agy) startedsync-versions.sh && npm ci && npm test && <validators>withWaitMsBeforeAsync: 10000and noBypassSandbox. Earlier commands in the same run hadBypassSandbox: true.node --testthen never exits becausebrowser.test.mjskeeps a handle open. The task log stops at 12:59:59Z. I reproduced the hang outside T3 with a browser executable that fails to launch.retireInactivePromptreturnsdoneoncepromptWireSettledis done, andpromptInactivityPausedpauses while any tool runs. Nothing bounded it until a later send closed the session (ForceStopCascadeTree,kill_background_tasks=true).brain/<session>/.system_generated/tasks/task-N.log), so the command's Details output stays empty and nothing shows whether it is alive or stuck. The provider handoff summary rendered the command asstatus=runningandExit code: unknownwith no output. The next agent ranpsafter the close, found nothing, and reported the indicator as stale.NotificationTimeoutSeconds(a "still running" notice) and a prompt telling the model to set a bounded wake-up, but none of about 13,000 localrun_commandcalls since 2026-11-14 used it, so the model apparently cannot reach it. The 1.5.14 changelog changes nothing here.So silent post-settle holds need a bound even for commands the agent did mean to wait on, and tailing the task log into the command item would give the UI and handoffs real evidence.
fix: release hung Antigravity background holds
redrixvix commentedon Nov 21, 2026
I saw a related stall in a top-level Antigravity ACP thread on macOS arm64 with Gemini 4 Neon. The background command finished and Antigravity recorded the result, but T3 held the turn open until I stopped it.
WaitMsBeforeAsync: 10000. Antigravity returnedsession/promptsuccessfully at 15:44:44 UTC on November 21, 2026.Task … finished with resultand62 passed (50.4s). Its transcript shows a subsequent planner step requesting a command to summarize the test output. I found no execution record for that follow-up and no corresponding completion of the T3 turn.The incident preceded the local update to
0.1.12-nightly.20261121.5051at 16:28 UTC. The previous build was likely0.1.12-nightly.20261121.5038, based on the desktop update log. The latest patch addresses ACP history replay in #40328. This command started live, and5051still defers settlement for running non-daemon Antigravity commands. I have not reproduced the incident on5051.This looks related to the settlement behavior reported here. In this case Antigravity itself logged that the background task finished, so it may help to check whether its terminal tool update or the subsequent wake reached T3.
Triaged with Codex in T3 Code.