fix(cli): keep cancelled agent sessions idle - #13601
Merged
Merged
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (4 files)
Reviewed by grok-4.6 · Input: 170.6K · Output: 15.1K · Cached: 1.1M Review guidance: REVIEW.md from base branch |
marius-kilocode
enabled auto-merge
August 31, 2026 10:20
WebReflection
approved these changes
Aug 31, 2026
WebReflection
left a comment
Contributor
There was a problem hiding this comment.
The intent is clear, I am just wondering if the Bus could ever raise an error instead and, if that's the case, how would we ensure the promise is not "forever pending" because closed.reject is never reached.
Collaborator
Author
|
@WebReflection would we actually care in the test? The timeout seems sufficient as failure for me. |
Contributor
fair point, I guess we have other venues to also test failures too, comment addressed, thank you. |
This was referenced Aug 31, 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
Stopping an agent with Esc or the Stop button could show the Finished attention icon, even though the agent had not completed its work. This made deliberate cancellations look like completed turns that needed review.
Why This Change Was Made
The runner returns the last assistant message after cancellation. That recovery result is successful, so the turn-close resolver could incorrectly classify it as completed. Record an interrupted outcome in the cancellation fallback, while preserving an existing explicit outcome such as a terminal error.
User Impact
Evidence
The regression test reproduced
completedbefore the fix and now receivesinterrupted. Coverage also checks the actual webview abort request, rendered Idle state, and a later normal completion.Local validation passed:
Manual verification used a fresh CLI build, isolated VS Code, and a credential-free local provider. Esc showed Idle, Stop showed Idle, and a subsequent normally completed turn showed Finished. These screenshots exercise local sessions inside Agent Manager; worktree sessions use the same backend cancellation path.
Esc: Idle, with no Finished checkmark
Stop button: Idle, with no Finished checkmark
Normal completion after cancellation: Finished