feat(vscode): cancel in-flight requests with Escape. - #789
Open
arpan7sarkar wants to merge 1 commit into
Open
Conversation
arpan7sarkar
requested review from
Avtrkrb,
akramcodez and
will-lamerton
as code owners
August 4, 2026 09:16
Contributor
Author
|
Hey @akramcodez do check it out and let me know if any changes are needed . |
14 tasks
Contributor
Author
|
Hey @will-lamerton , @Avtrkrb , @akramcodez , Do check this functionlity out , its perfectly working let me now if any change is needed , else merge it |
akramcodez
approved these changes
Aug 7, 2026
akramcodez
left a comment
Collaborator
There was a problem hiding this comment.
LGTM @arpan7sarkar, amazing work on this!
Contributor
Author
|
Thanks @akramcodez , now waiting for another review :) |
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.
Description
Implements #758
Pressing Escape in the VS Code extension's chat panel now cancels an in-flight LLM request, mirroring the existing Stop button. The listener is bound on the webview's document (not just the chat input) so it fires even when focus has moved to a tool card, dropdown, or the streaming response area, and it's guarded by isProcessing so it's a no-op when idle. Also added a nanocoder.cancel command for the Command Palette.
While wiring this up, found that cancelling mid-stream surfaced as a Nanocoder prompt failed: RequestError: Internal error toast — AcpAgent.prompt was throwing a generic error on abort, and the ACP JSON-RPC layer flattened it into an opaque failure. Fixed that too: cancellation is now recognized explicitly, reported inline in the chat as "Cancelled by user", and resolved with stopReason: 'cancelled' instead of rejecting. NanocoderAcpClient also tracks an in-flight cancel client-side and suppresses the toast for it, so this holds even against a CLI build that hasn't picked up the agent-side change. Genuine errors still show the toast as before.
Type of Change
Changeset
pnpm changeset) describing this change for the changelogDocs-only or internal chores need no changeset (or run
pnpm changeset --emptyto note that intentionally).Testing
Automated Tests
Manual Testing
Checklist