Repository navigation
Add run_cancel tool so managers can stop runs themselves - #236
Merged
Merged
Conversation
Paused runs (usage limit, budget, a question) could only be stopped from the UI. run_cancel stops a queued, running or paused run for good, also when its chat works on another computer of the group (forwarded over the link). It refuses the caller's own run and the runs above it.
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.
Paused runs (on a usage limit, a budget or a question) could only be stopped with the Stop button. When a stand-in Mac hit its weekly Claude limit, 16 paused runs were set to resume days later and repeat outreach and posting, and no agent could stop them.
What changes
run_cancel({ runId, reason? })for manager agents (same gate asrun_continue): stops a queued, running or paused run for good, together with the work it delegated. A paused run never resumes by itself afterwards./api/link/runs/:id/stop, falling back to the plain cancel for older computers). An offline computer gives a clear error and nothing is closed locally.run.cancel).runs_list.Tests
packages/core/test/run-cancel.test.ts: paused and queued runs close, ended runs stay, own/parent runs refused, unknown runner refused, non-managers don't get it.