fix(desktop): abort agent loop on plan_response cancel#2225
Merged
esengine merged 1 commit intoMay 29, 2026
Conversation
## What Add abortTurn(tab) in the plan_response cancel handler. ## Why When the user cancels a plan, the agent loop continues running. The model receives the cancellation signal via pauseGate but the in-progress turn is not aborted, causing the model to re-submit the plan or continue generating output that the user already rejected. ## How to verify 1. Start a session with plan mode enabled 2. Let the model submit a plan via submit_plan 3. Click Cancel in the plan approval 4. Confirm the agent loop stops immediately — no further streaming or tool calls from the rejected turn
esengine
approved these changes
May 29, 2026
esengine
left a comment
Owner
There was a problem hiding this comment.
Clean 1-line fix, split out of #2072 — cancelling a plan now abortTurn(tab) before clearing plan state and emitting $plan_cleared, so an in-flight turn actually stops on cancel instead of running on after the plan's gone. Correct. CI green. Merging.
This was referenced May 29, 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
Add abortTurn(tab) in the plan_response cancel handler.
Why
When the user cancels a plan, the agent loop continues running. The model receives the cancellation signal via pauseGate but the in-progress turn is not aborted, causing the model to re-submit the plan or continue generating output that the user already rejected.
How to verify
What
Why
How to verify
Checklist
npm run verifypasses locally (lint + typecheck + tests + comment-policy gate)Co-Authored-By: Claudetrailer in commitsCHANGELOG.md— release notes are maintainer-written at release time