[Bug]: Stopping background work leaves thread stuck in "Monitoring" / "Stopping..." indefinitely #11428
Metadata & Triage#
- Type: Bug (
bug) - Area:
apps/server,apps/web - Estimated Fix Size:
size:S(10–29 lines in provider interrupt / task completion cleanup) - Impact: Major degradation or frequent failure
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Steps to reproduce#
- Run a thread where a background command or watch loop (e.g., monitor task, background shell, or log tail) outlives the turn.
- Once the assistant turn finishes and settles, the thread shows a
Monitoringpill in the sidebar and a• Monitoringbanner with aStopbutton above the composer. - Click the
Stopbutton on the banner.
Expected behavior#
The background tasks should be stopped/interrupted, task.completed or terminal status should be emitted for the running background tasks, the background liveness should clear from the thread, and the Monitoring / Stopping... banner should disappear.
Actual behavior#
The button switches to Stopping..., but the thread remains stuck in Monitoring indefinitely. The Stopping... state never clears.
Screenshots#
1. Thread showing "Monitoring" badge in sidebar and composer banner with "Stop" button:

2. Stuck on "Stopping..." indefinitely after clicking Stop:

Root Cause Analysis#
- In
apps/web/src/components/ChatView.tsx,handleStopBackgroundWorkcallsinterruptThreadTurnunder the assumption that it tears down live background work across the thread:// Background work (subagent fleets, workflow runs, watch loops) can outlive // the turn; once it settles, the composer stop button is gone, so this // banner is the only visible stop affordance. Stop routes through the // stop-everything interrupt: it kills every live background task before // interrupting, and works by session, so no active turn is needed.isStoppingBackgroundWorkholds"Stopping..."untilactiveBackgroundLiveness === null. - When
interruptThreadTurnis called after a turn has settled,turnIdis undefined. - In
ProviderCommandReactor.ts, the command routes toproviderService.interruptTurn({ threadId: event.payload.threadId }). - If the provider adapter's
interruptTurnimplementation only handles active prompt execution (cancelling active generation / pending approvals) rather than terminating lingering background tasks/commands or emitting terminal task states,ThreadBackgroundLivenessServiceis never notified that the background task ended. - Because no
task.completedor terminal event is received,ThreadBackgroundLivenessServicekeeps the task in itsmonitorsset. - As a result,
activeBackgroundLivenessremains"monitoring", the sidebar badge remainsMonitoring, and the composer banner stays stuck inStopping....
Note on provider implementation: This was observed with the Antigravity provider, where
AntigravityAdapter.tsonly callscontext.runtime.canceland cancels pending requests insideinterruptTurn, but does not clean upcontext.commandsor invokefinishBackgroundCommands(context).
Version or commit#
Latest upstream main @ b1e223e2b (v0.0.41-nightly.20260912.1599)
Environment#
Desktop / Web app
dkritarth(GitHub profile, opens in a new tab) changed the title
juliusmarminge closed this
Sign in to join this conversation.
Fixed by #13388 — Antigravity
interruptTurnnow stops the session when Stop is pressed with no active prompt and a promoted background command is still running, so Monitoring clears instead of sticking on Stopping…