Repository navigation
Open
Description
Before submitting
- I searched existing issues and did not find a duplicate (related to [Bug]: A thread waiting on an agent-scheduled wake looks finished, and the wake is announced by a generic untranslated divider #39795 and Antigravity orphaned background commands hold completed turns in running with no UI indicator and deadlock delegated parent threads #39820 / fix(antigravity): bound silent post-settle background command holds #40858, but distinct root cause and impact).
- I included enough detail to reproduce or investigate the problem.
Area
apps/server
Summary
When an Antigravity (agy acp) agent calls its native schedule tool (for example, a 3-hour one-shot timer with DurationSeconds: 10800), T3 Code keeps the active run (status: "running") and provider_turn open for the entire duration of the timer, even after session/prompt succeeds and Antigravity is completely idle. Because postSettleCommandHold (30 minutes) explicitly excludes ANTIGRAVITY_SCHEDULE_TITLES, the turn never finalizes, startNextQueuedRun never fires, and all queued runs (T3 scheduled automations, user-queued messages, t3_thread_send(..., mode: "queue"), freshContext: true, /compact) starve for hours, while delegated sub-agent completions keep jumping ahead of the queue via steer_active.
Steps to reproduce
- Open a T3 Code thread on the Antigravity provider (
agy1.5.14, e.g.,gemini-4-neon). - Have the agent call Antigravity's native
scheduletool (e.g.,DurationSeconds: 10800) and finish its turn (session/promptreturnssucceeded/end_turn). - Queue a message on the thread: either let a bound T3 scheduled task fire (
thread_mode: "continue", wheresendBoundhardcodesmode: "queue"), queue a message in the composer, or callt3_thread_sendwithmode: "queue". - Optionally, have an async
delegate_taskchild complete on the same thread while the queued run is waiting.
Actual behavior
session/promptfinishes cleanly (status: "succeeded"), Antigravity is idle, andcloseTextStreams(context)clears the active generation indicator, yet the run andprovider_turnstay instatus: "running"indefinitely (red Stop button remains active).- Queued runs never start until the native timer expires (hours later) or the user manually clicks Send now (
queued-message.promote-to-steer).- Observed live on
0.1.12-nightly.20261122.5111: run 190 started at11:11:51Z, the agent set a 3-hour nativeschedule(DurationSeconds: 10800) at11:31:59Z, and a bound T3 scheduled automation queued as run 191 at11:30:17Zsat undelivered for ~2 hours until manually promoted at13:29:49Z. During those 2 hours,session/promptcompleted cleanly over a dozen times with 5 to 10+ minute idle gaps. The same lock occurred earlier on the same thread in run 92 (DurationSeconds: 6060pinned run 92 from02:23Zto04:05Z, blocking queued run 93 at03:28Z).
- Observed live on
- Every
delegate_taskcompletion jumps ahead of the queued run viaprovider-turn.steer(steerWithPrompt), causing indefinite FIFO queue starvation. - Because
AntigravityAdapterV2does not populatependingBackgroundTasksfor activeRun scheduletools, the UI hides what is actually holding the run open (if an unrelated sub-agent has a pending background task, theWaiting ·banner displays only that sub-agent, making the parent thread appear idle and merely waiting on sub-agents while refusing to deliver queued messages).
Root cause (traced in 0.1.12-nightly.20261122.5111)
src/provider/acp/AntigravityProtocol.ts+AcpAdapterV2:antigravityToolOutlivesPromptreturnstrueforANTIGRAVITY_SCHEDULE_TITLES(new Set(["Run schedule", "Running schedule"])), sofollowPromptseeshasDeferredBackgroundWork(context) === trueand skipsfinalizeTurnaftersession/promptsettles.- No timeout on schedule holds:
AntigravityAdapterV2configurespostSettleCommandHold: { timeout: "30 minutes", isCommand: antigravityCommandOutlivesPrompt }(from fix(antigravity): bound silent post-settle background command holds #40858 / Antigravity orphaned background commands hold completed turns in running with no UI indicator and deadlock delegated parent threads #39820), andantigravityCommandOutlivesPromptexplicitly returnsfalseforANTIGRAVITY_SCHEDULE_TITLES. ThusschedulePostSettleHoldExpirynever releases a schedule-held turn. - Asymmetric dispatch causes queue starvation (
Orchestrator.dispatchMessage):delegatedCompletionwakes (completionWake === "always") are automatically upgraded fromqueue_after_activetosteer_activewheneversupportsActiveSteering && activeSteeringInterruptsTools !== true(antigravitySteersWithPromptis true onagy >= 1.5.0).- Bound scheduled tasks (
sendBoundhardcodesmode: "queue"), user-queued messages,freshContext: true, and slash commands remain strictlyqueuedand can only start instartNextQueuedRunafter the active run reaches a terminal status.
- Comparison with
ClaudeAdapterV2: When Claude callsScheduleWakeup,ClaudeAdapterV2finalizes the turn immediately (completed), exposesCLAUDE_SCHEDULED_WAKEUP_TASKinpendingBackgroundTasks, pins the subprocess againstDEFAULT_IDLE_TIMEOUT_MS(30m) viahasPendingBackgroundWork, and lets the later wake run as a continuation turn. By contrast,AntigravityAdapterV2already setsenablePostSettleContinuation: true, yet keepsdeferFinalizeForBackgroundWork: trueforANTIGRAVITY_SCHEDULE_TITLESand does not implementextractBackgroundTaskId/pendingBackgroundTasks(likely as a workaround for [Bug]: A thread waiting on an agent-scheduled wake looks finished, and the wake is announced by a generic untranslated divider #39795, where a completed turn with a pending schedule looked finished in the UI).
Expected behavior / Suggested fix
- Match
ClaudeAdapterV2'sScheduleWakeuparchitecture for Antigravity schedules (and ideally post-settle background work):- Do not hold
activeTurn/runinrunningforANTIGRAVITY_SCHEDULE_TITLESoncesession/promptsettles. - Track running Antigravity
scheduletools inrunningBackgroundTaskIdsand publish them inpendingBackgroundTasks(giving the sidebar andWaiting ·banner accurate visibility as requested in [Bug]: A thread waiting on an agent-scheduled wake looks finished, and the wake is announced by a generic untranslated divider #39795, and pinning theagy acpsubprocess past the 30-minute idle timeout viahasPendingBackgroundWork). - Call
finalizeTurnwhensession/promptcompletes sostartNextQueuedRunimmediately drains queued messages and scheduled automations, and letbufferPostSettleWake+offerContinuationRun(enablePostSettleContinuation: true) start a continuation run when the schedule fires.
- Do not hold
- Prevent queue starvation during post-settle hold: While a turn is in
promptSettled === trueidle hold (not actively mid-prompt), do not let newly arrivingdelegatedCompletionsteers bypass older queued runs (or yield/finalize the idle hold when an unheld queued run is waiting).
Version and environment
- T3 Code:
0.1.12-nightly.20261122.5111(t3 serve) - Antigravity CLI:
agy1.5.14(gemini-4-neon,full-access) - OS: Ubuntu 26.04 LTS (x86_64)
Reacted by Soami Kapadia
Metadata
Metadata
Assignees
Labels
No labels
Activity
Luzivog commentedon Nov 24, 2026
Update: Same starvation now hits non-daemon background
run_commandwaits onagy 1.5.15–1.5.16(bypassing#40858)After blocking Antigravity's native
scheduletool locally via aPreToolUsehook, we hit the exact same queue starvation on non-daemon backgroundrun_commandexecutions, which account for the vast majority of Antigravity queue stalls in production.t3 20261122.5111,agy 1.5.15/16)Root cause observed live (Nov 24,
0.1.12-nightly.20261122.5111)agy 1.5.15+keepssession/promptunsettled for the entire lifetime of a non-daemon backgroundrun_command(promptSettled === false):15:57:45Z. A user reply arrived at15:59:31Zviaqueue_after_active(Run Guard git quick actions for diverged or stale branch status #47,queued).16:02:31Z, the agent launched a non-daemon backgroundrun_command(NotificationTimeoutSeconds: 300), emitted a short"Waiting on ..."line at16:02:42Z, and went completely idle (re-emitting one waiting line after the 300 s notification at16:07:57Z).session/promptnever settled while the command ran (36.5 min total; Run Refresh upstream state after branch checkout and invalidate git queries #46 remained open 41.2 min until failing on quota at16:38:59Z).#40858and the inactivity watchdog did not help:#40858's 30-minutepostSettleCommandHoldtimer only arms oncepromptSettled === true(and resets on any activity event). Becauseagykeptsession/promptopen,#40858never armed.retireInactivePromptis paused whenever any tool hasstatus === "running"(promptInactivityPaused), leaving zero timeout or release valve.supportsActiveSteering: true(viasteersWithPrompt) andactiveSteeringInterruptsTools !== true. When the user manually clicked Steer (promoteToSteer) at16:27:16Z(after 27.8 min queued),agy acpaccepted the steeredsession/promptin 28 ms without interrupting the running background command.Orchestrator.dispatchMessageonly auto-upgradesdelegatedCompletionwakes (andt3_thread_send(mode: "auto")) tosteer_active, leavingqueue_after_activehuman replies (e.g. from external clients/mirrors) andpr-watchnotifications starved behind the idle turn.derivePendingBackgroundWorkreturns[]wheneverhasActiveRun === true, hiding the blocking command fromThreadShell.pendingBackgroundTasksacross web, mobile, and downstream clients.Fleet impact measured in
statev2.sqlite(Nov 20 to Nov 24, 4.5 days)pr-watchruns (11.7 h) and 8scheduledruns (2.4 h).schedulewas only 7.6% (4 runs, 140 min); backgroundrun_commandholds (17 runs, 298 min), unended subagent waits (34 runs, 409 min), and long/stalled turns (30 runs, 987 min) accounted for 92.4%.Concrete 3-part fix
steer_activewhen a turn is parked on background work: When an active run is in post-settle hold,waiting, or pre-settle quiet (no streaming assistant/reasoning activity, only backgroundexecute/subagent tools running) and the session supportssupportsActiveSteering && activeSteeringInterruptsTools !== true, automatically promote queued human messages,pr-watchwakes, and scheduled runs viasteerWithPromptinstead of letting onlydelegatedCompletioncut ahead.AntigravityAdapterV2's 30-minutedeferFinalizeForBackgroundWorkhold with immediate run finalization +pendingBackgroundTasks+enablePostSettleContinuation(aligning with open fix(antigravity): advertise supportsBackgroundWait and honor awaited: false #39990 and fix(antigravity): Show background command summaries and live output #40687).ThreadShellduring active runs: StopderivePendingBackgroundWorkfrom returning[]unconditionally whenhasActiveRun === trueso UIs and mirrors show what is holding the turn open.skap3214 commentedon Nov 24, 2026
Same bug on macOS 27.0.1 with T3 Code
0.1.12-nightly.20261123.5124,agy1.5.14,gemini-4-neon, full access. Adding data for long, chained timers, where the hold never clears by itself.runningfor 34 hours (since 2026-11-23T09:03Z, still running at 2026-11-24T19:50Z). Everysession/promptin that time returnedsucceeded, and the agent is idle between them.schedulecalls in the thread, 8 of them withDurationSeconds: 86400(T+24h post-deploy checks). A 24 h timer has been pending without a gap since 2026-11-23T10:38Z, because the agent sets the next one before the previous one fires. Six are pending now, and the last fires at 2026-11-25T07:56Z.message:pr-watch:*user messages queued between 2026-11-23T09:22Z and 11:57Z are stillqueuedmore than 34 hours later.cancelledand the message is steered into the held run.dynamic_toolitems titledRun schedulewith statusrunning, and the thread'spendingBackgroundTasksis empty. The thread looks like a reply that never finishes.An agent that verifies deploys at T+15m, T+1h and T+24h produces this pattern every time, so the thread stays in Working for as long as the agent keeps doing that work.