Skip to content

feat: Support individual subagent cancellation#13924

Open
tomjw64 wants to merge 1 commit intoanomalyco:devfrom
tomjw64:individual-subagent-cancel
Open

feat: Support individual subagent cancellation#13924
tomjw64 wants to merge 1 commit intoanomalyco:devfrom
tomjw64:individual-subagent-cancel

Conversation

@tomjw64
Copy link

@tomjw64 tomjw64 commented Feb 17, 2026

What does this PR do?

Closes #13916

Adds support for interrupting subagent tasks with a clickable button or the session_interrupt keybinding in the TUI. The motivation behind this work is twofold:

  1. Face-value: Support this feature so that individual subagents can be cancelled when a group of subagents is run without cancelling everything
  2. Support this feature as a prerequisite to background subagents. This can give us a way to abort background subagents without creeping the scope of that feature addition too much. See: [feat] True Async/Background Sub-Agent Delegation #5887, feat(opencode): Support background subagents #13261

Screenshot before

Screenshot from 2026-02-16 20-15-39

Screenshot after:

Screenshot from 2026-02-16 20-11-18 Screenshot from 2026-02-16 20-11-22

How did you verify your code works?

Ran the following prompt repeatedly:

Run 2 general subagents in parallel. Each one should use bash to
sleep for an amount of time and then print out a random number. Have them sleep
for 30 seconds each. Then print out a chart to be
updated as each task notifies you of its completion.

And tested interrupt behavior including:

  • That interrupt must be re-confirmed after changing session views
  • That old interrupt confirmation timeouts don't overlap with the current timeout
  • That subagents can be interrupted individually, without affecting the others
  • That the primary agent continues as expected when all subagents terminate, via interrupts or successful completion
  • That the primary agent can be interrupted
  • That the parent agent sees the message that the task was cancelled by the user

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.

[FEATURE]: Individual task cancellation

1 participant

Comments