microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.14k stars 28.83k forks source link

Operation Canceled in VSCode Extension Host Process #204703

Open felixhaeberle opened 8 months ago

felixhaeberle commented 8 months ago

Description

An error occurred indicating an operation was canceled within the Visual Studio Code extension host process. This cancellation appears to be unhandled and has been reported as an error. The issue was encountered in the context of extension operations, potentially involving GitHub Copilot Chat extension activities.

Error Details

Stack Trace

Potential Issue

The cancellation error suggests an asynchronous operation initiated by the extension(s) was terminated prematurely. This could result from user action, internal logic conditions not being met, or other extensions interfering with normal operations.

Steps to Reproduce

  1. Run Visual Studio Code on macOS 14.0 with the GitHub Copilot Chat extension version 0.11.1 installed.
  2. Engage in activities that involve extension host processes, such as initiating Copilot sessions or other extension-related operations.
  3. The cancellation error may manifest under conditions where operations are interrupted or cannot complete as expected.

Expected Behavior

Operations within the VSCode extension host, especially involving extensions like GitHub Copilot Chat, should complete successfully or handle cancellations gracefully without resulting in unhandled errors.

Actual Behavior

An operation was canceled within the extension host process, leading to an unhandled error that could potentially disrupt user workflow or extension functionality.

Suggested Fix

Environment

Bildschirmfoto 2024-02-08 um 11 05 08 Bildschirmfoto 2024-02-08 um 11 05 24
ross-chipstack commented 5 months ago

I'm seeing this any time I run > Developer: Reload Window

OfekShilon commented 4 months ago

I suspect this originates in the last line here: https://github.com/microsoft/vscode/blob/3e8b60f276587a4d2a4d24b8d81729c3a9c9373e/src/vs/platform/clipboard/browser/clipboardService.ts#L43-L61

We're seeing lots of similar errors in compiler-explorer (utilizing monaco-editor), when users browse from Safari.

The cancel call is:

    cancel() {
        return this.error(new CancellationError());
    }

AFAICT this isn't part of anything async, so maybe the intention was to throw and not return this CancellationError? But I really don't know what I'm talking about and don't have a macOS to try and debug this.

@jrieken Maybe you can help?