Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 21, 2025

Remote kernel picker stayed busy when a command provider threw CancellationError, leaving the UI stuck instead of dismissing.

  • Quick pick state handling

    • Always clear the quick pick’s busy flag in selectRemoteServerFromRemoteKernelFinder via finally, so cancellation/error paths release the UI.
  • User impact

    • Kernel/server commands that cancel (e.g., “Open documentation”, “Upgrade account”) now return the picker to the previous UI instead of spinning indefinitely.
try { if (lazyQuickPick) { lazyQuickPick.busy = true; } const ret = await this.selectRemoteServerFromRemoteKernelFinder(selectedSource, state, token); return ret; } finally { if (lazyQuickPick) { lazyQuickPick.busy = false; // ensures cancellation unblocks the picker } taskNb.dispose(); }
Original prompt

This section details on the original issue you should resolve

<issue_title>Extension API: Throwing a CancellationError does not dismiss the kernel picker.</issue_title>
<issue_description>Originally reported this bug / brought it up in #16434 (comment). Figured opening a standalone issue is best.


I've got a couple commands which ultimately don't resolve kernels (e.g. Open documentation and Upgrade account).

Image

The API docs say Returning undefined or null will result in the previous UI being displayed for back-style behaviour ... and If however users exit the UI or workflow ... extensions are then expected to throw a CancellationError, else the previous UI will be once again.

In handling these non-resolving commands, I've tried both returning undefined, null and throwing a CancellationError, but it's not dismissing the picker. Instead the picker stays stuck in a pending/loading state.

Image

Seems to be an issue only in handleCommand since throwing a CancellationError in provideCommands dismisses the kernel picker as expected.

Am I doing something wrong? Or misinterpreting the API?</issue_description>

<agent_instructions>Perform a root cause analysis to determine the cause of the issue, then attempt to fix this</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: DonJayamanne <1948812+DonJayamanne@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix CancellationError handling in Extension API Ensure kernel picker exits loading state on cancellation Dec 21, 2025
Copilot AI requested a review from DonJayamanne December 21, 2025 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants