Repository navigation
fix(server): Stop ends the agents' check-backs - #1057
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Pressing Stop interrupted the turn but left check-backs a Claude agent set (ScheduleWakeup, CronCreate) alive in its runtime, so a recurring one kept waking the agent and spending usage after the user stopped it. The Stop decision now also requests a check-back cancel for every agent in the thread that holds one, room agents included. The existing cancel path stops that agent's runtime, the only way to drop a schedule, along with background work it left running. Jobs saved to the project count too: they would fire in that runtime; they stay listed and come back the next time the agent runs. thread_stop on a child, local or on a linked computer, now treats a check-back as work to stop instead of answering not_running.
Claude reports its check-back list only when a turn ends, and a stopped turn may never get there, so Stop missed a check-back set earlier in that same turn. The adapter now publishes the list as soon as ScheduleWakeup, CronCreate or CronDelete returns; Claude's report at the turn's end replaces it whole. thread_stop now counts any check-back, including one saved to the project: in a room, the thread's single session doesn't show whether another agent's runtime is still up. For a child on a linked computer, the stop goes even when the child reads as idle, since only that computer can see its check-backs, and it stops the child only if something is still going.
…k-backs - A check-back the stopped turn set, reported just after Stop read the list, is cancelled by ingestion while the session's Stop is pending. - A fresh Claude runtime's updates before its first report are partial: ingestion keeps the saved jobs already listed instead of dropping them. - The cancel stops a runtime only if its provider sets check-backs, so a saved Claude job on an agent now running Codex can't stop Codex. - Removing a link stops a thread it started that has only a check-back. - thread_stop no longer sends a stop to a quiet child on a linked computer: it could kill a turn started there before a delayed stop lands. A check-back-only linked child is a documented limit.
…description thread_stop now says a quiet child with only a check-back counts as running and is stopped, and what happens for a child on a linked computer. That is 17 bytes, worth it so the agent knows a stop ends the child's check-backs.
badcuban
force-pushed
the
fix/stop-ends-check-backs
branch
from
November 23, 2026 16:42
c5ebc33 to
50c2016
Compare
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pressing Stop interrupted the turn but left the check-backs a Claude agent had set (ScheduleWakeup, CronCreate). A recurring one kept waking the agent and spending usage after the user pressed Stop.
Fix. The decider's
thread.turn.interruptnow also emitsthread.check-back-cancel-requestedfor every agent in the thread that holds a check-back, room agents included. The reactor's existing cancel handler stops that agent's runtime, the only way to drop a schedule from a live Claude CLI. This covers every user Stop (chat button, keybinding, command palette, phone) and outside agents' Stop, since they all send this command.hasLiveCheckBack. Before, it answerednot_runningand left the check-back alive.partial, and ingestion keeps the saved jobs already listed, so they don't drop off the Scheduled page.checkBackscapability). A saved Claude job left on an agent that switched to Codex no longer stops the Codex runtime.Known limits.
thread_stopfor a quiet child on a linked computer that has only a check-back answersnot_runningand leaves it. The status the other computer sends doesn't include check-backs. Sending the stop anyway could kill a turn the user starts there before a delayed stop arrives, and an older computer wouldn't stop it anyway. The fix is to add check-backs to that status, which changes the link protocol, so it's left for a follow-up. A stop for a working child does end its check-backs.The guide topics for scheduled tasks and child threads, the
thread_stoptool description, and docs/design/child-threads.md now describe this.Tested by a new reactor test: a room where both agents hold check-backs (one saved to the project, one agent running background work). Stop stops both runtimes. The test fails without the decider change. A new check-back module test covers the list as it changes when each tool returns. A new ingestion test covers a check-back reported after Stop for the stopped turn, which is cancelled, and a partial list, which keeps the saved job. A new reactor test covers a runtime whose provider sets no check-backs, which is left running. Each new test fails without its change.
agentContextBudget.json: on-demand tool definitions grow 17 bytes, for thethread_stopdescription saying a quiet child with only a check-back is stopped too.