Skip to content

feat: Support individual subagent cancellation#13924

Closed
tomjw64 wants to merge 1 commit into
anomalyco:devfrom
tomjw64:individual-subagent-cancel
Closed

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

Conversation

@tomjw64
Copy link
Copy Markdown

@tomjw64 tomjw64 commented Feb 17, 2026

Issue for this PR

Closes #13916

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

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

Screenshots / recordings

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

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

@rekram1-node
Copy link
Copy Markdown
Collaborator

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

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

2 participants