Skip to content

Cancel active subagents when cancelling a parent conversation - #173

Closed
winterqt wants to merge 1 commit into
boldsoftware:mainfrom
winterqt:cancel-subagents
Closed

winterqt wants to merge 1 commit into
boldsoftware:mainfrom
winterqt:cancel-subagents

Conversation

@winterqt

@winterqt winterqt commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

When a parent conversation is cancelled, look up its subagent conversations from the database and cancel any that are actively working. This prevents orphaned subagent loops from continuing to run (and consume resources) after the parent has been stopped.

Added cancelSubagents() to Server which queries for child conversations and cancels their active managers. Called from handleCancelConversation before cancelling the parent itself.

Added TestCancelParentCancelsSubagents to reproduce the bug: starts a parent that spawns a subagent running a long bash command, cancels the parent, and verifies the subagent also stops.

Fixes #170

When a parent conversation is cancelled, look up its subagent conversations
from the database and cancel any that are actively working. This prevents
orphaned subagent loops from continuing to run (and consume resources) after
the parent has been stopped.

Added cancelSubagents() to Server which queries for child conversations and
cancels their active managers. Called from handleCancelConversation before
cancelling the parent itself.

Added TestCancelParentCancelsSubagents to reproduce the bug: starts a parent
that spawns a subagent running a long bash command, cancels the parent, and
verifies the subagent also stops.

Fixes boldsoftware#170

Co-authored-by: Shelley <shelley@exe.dev>
@cla-bot cla-bot Bot added the cla-signed label Apr 3, 2026
@philz

philz commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

I think we've implemented this in the intervening months.

@philz philz closed this Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parent agent cancellation does not cancel subagents

2 participants