Skip to content

Add run_cancel tool so managers can stop runs themselves - #236

Merged
danielehrhardt merged 2 commits into
mainfrom
feat/run-cancel-tool
Oct 23, 2026
Merged

danielehrhardt merged 2 commits into
mainfrom
feat/run-cancel-tool

Conversation

@danielehrhardt

Copy link
Copy Markdown
Contributor

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

  • New Godmode tool run_cancel({ runId, reason? }) for manager agents (same gate as run_continue): stops a queued, running or paused run for good, together with the work it delegated. A paused run never resumes by itself afterwards.
  • Runs of chats that work on another computer of the group are stopped there over the link (/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.
  • Refuses the caller's own run and the runs that handed it its task, keeps the reveal/computer/VM guards of the other manager tools, and is audited (run.cancel).
  • On a secondary it runs on the primary like runs_list.
  • Orchestrator prompt, activity labels, chat tool meta and ARCHITECTURE.md mention it.

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.
  • Core and desktop typecheck pass. Full core suite: the only failures (maintenance, mods, updates, VM lifecycle) fail the same way on main without this change.

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.
@danielehrhardt
danielehrhardt merged commit ceef868 into main Oct 23, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant