feat: keep background agents running when the main agent stops - #13641
Merged
Conversation
Escape and the main Stop button now abort only the current session's turn and foreground work, so asynchronous subagents keep running and their results are retained until the user sends the next message. Adds a shared background-agent state provider, a session-dock activity count that opens the existing top agent bar, and per-agent plus stop-all controls there.
The count button now shows the running total with the existing background-agent string as its accessible name, so the duplicate badge translations are removed from all locales.
Keeps scoped stop with retained results, continuation after a background result, tree-scope descendant cancellation, and foreground-versus-async child handling. Drops the promoted-child, attachment-intake, queued-continuation, gate, and extra-width cases, and restores the simpler agent row loop.
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Previous Review Summary (commit 9d2a4ac)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 9d2a4ac)Status: No Issues Found | Recommendation: Merge Files Reviewed (4 files)
Reviewed by grok-4.6 · Input: 194.8K · Output: 4.8K · Cached: 82.2K Review guidance: REVIEW.md from base branch |
Merge current main and remove the composer activity UI, keeping Stop all in the existing background-agent bar. Keep paused background tickets inactive after continuation and prevent failed commands from resuming stopped sessions.
marius-kilocode
force-pushed
the
improve-esc-subagent-control
branch
from
September 1, 2026 10:04
9d2a4ac to
1954690
Compare
marius-kilocode
enabled auto-merge
September 1, 2026 10:28
iscekic
approved these changes
Sep 1, 2026
This was referenced Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
In the VS Code extension, Esc and the main Stop button cancelled asynchronous subagents along with the parent. Interrupting the parent to send a correction could therefore discard background work.
Why This Change Was Made
Separate parent interruption from deliberate background cancellation. The abort endpoint accepts
scope=sessionto stop the current turn and foreground work while preserving asynchronous children. The defaultscope=treeremains unchanged for lifecycle shutdowns and other clients.A per-session pause gate retains completed background results without restarting an interrupted parent. Sending a message or using Continue resumes the parent with those results. The review fixes also keep paused background injections inactive across a later continuation and prevent an invalid slash command from unpausing a stopped session.
User Impact
Evidence
The earlier isolated VS Code run verified parent-only interruption and retained results against a local test model. The reduced UI is covered by browser tests; the isolated VS Code relaunch failed in the local test harness, so there is no claim of a fresh native-editor end-to-end run.