Skip to content

Cancel active subagents when cancelling a parent conversation#173

Open
winterqt wants to merge 1 commit intoboldsoftware:mainfrom
winterqt:cancel-subagents
Open

Cancel active subagents when cancelling a parent conversation#173
winterqt wants to merge 1 commit intoboldsoftware:mainfrom
winterqt:cancel-subagents

Conversation

@winterqt
Copy link
Copy Markdown
Contributor

@winterqt winterqt commented Apr 3, 2026

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
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

1 participant