Repository navigation
feat(vscode): cancel in-flight requests with Escape. - #789
Conversation
|
Hey @akramcodez do check it out and let me know if any changes are needed . |
|
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
left a comment
There was a problem hiding this comment.
LGTM @arpan7sarkar, amazing work on this!
|
Thanks @akramcodez , now waiting for another review :) |
|
Hey @arpan7sarkar - nice PR. A few small things before merge: Blocking: Please also:
Non-blocking: |
|
Hey @will-lamerton , Thanks for giving me the broad picture and telling me the things that I am missing , I will add all this then raised a PR thanks |
|
Hey @arpan7sarkar, could you please resolve the merge conflicts when you get a chance? Thanks! |
|
Hello @akramcodez today i will update the fixex that @will-lamerton told me then after that i will commmit that in the mean time i was working on #814 this pr here i actully find a big ci issue that i have fixed and mentioned there you can have a look into that |
|
Hello @akramcodez @will-lamerton , Have implemnted all the requirments and also fixed merge conflicts have a look here :-) |
Resolves the plugins/vscode/media/chat-panel.css conflict: Nano-Collective#846 made the compiled CSS a build artifact (gitignored, emitted by `pnpm build:css`), so take main's deletion. This branch only touched the file's trailing newline - no CSS content is lost.
…#789) * feat(vscode): cancel in-flight requests with Escape. * fix(vscode): clear pending permissions when a request is cancelled * fix(vscode): repair malformed commands array from the main merge --------- Co-authored-by: Will Lamerton <[email protected]>
Hooks the background titler into the existing turn-end finally block, fire and forget so the turn returns to idle immediately. On success it sends a _nanocoder/sessionTitleChanged ext notification so an editor client can refresh its session list without polling. Turn success is tracked in a local flag rather than inferred from reaching the finally. The cancel path added in #789 returns from inside the catch, and the error path rethrows, and both still run the finally, so "we got here" says nothing about whether the turn completed. The session object carries no usable signal either: cancel() aborts its controller and immediately swaps in a fresh one. Three tests, and the two negative ones were verified as real pins by temporarily forcing the guard true and confirming they fail. Without that check they would have passed vacuously, since they also passed before any of this was wired up. Also carries titleGenerated forward on every save, alongside titleManuallySet, so a title survives the next turn's persist.
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