microsoft / vscode

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

"Report Issue" option in chat feedback menu does not trigger `contribIssueReporter` contributors #228019

Open bwateratmsft opened 1 week ago

bwateratmsft commented 1 week ago

Type: Bug

When executing the "Report Issue" feature in chat response feedback, it opens the issue reporter for the specific extension that contributes the chat handler, but it does NOT execute the command that extension specifies as part of the contribIssueReporter proposed API. As a result, no extra extension-provided data can be included in the issue report.

Image

VS Code version: Code - Insiders 1.93.0-insider (4849ca9bdf9666755eb463db297b69e5385090e3, 2024-09-04T13:13:15.344Z) OS version: Windows_NT x64 10.0.22631 Modes:

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz (20 x 3696)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off| |Load (avg)|undefined| |Memory (System)|126.84GB (99.46GB free)| |Process Argv|--log ms-azuretools.vscode-azure-github-copilot=debug --crash-reporter-id a639fe75-6727-46d4-bc6c-acdb3cb6366a| |Screen Reader|no| |VM|0%|
Extensions (21) Extension|Author (truncated)|Version ---|---|--- tsl-problem-matcher|amo|0.6.2 esbuild-problem-matchers|con|0.0.3 vscode-eslint|dba|3.0.10 codespaces|Git|1.17.2 copilot|Git|1.229.1095 copilot-chat|Git|0.21.2024090602 azure-dev|ms-|0.8.3 vscode-azure-github-copilot|ms-|0.2.42 vscode-azurecontainerapps|ms-|0.7.1 vscode-azurefunctions|ms-|1.15.3 vscode-azureresourcegroups|ms-|0.9.4 vscode-docker|ms-|1.29.2 vscode-dotnet-runtime|ms-|2.1.5 debugpy|ms-|2024.11.2024082901 python|ms-|2024.15.2024090406 remote-containers|ms-|0.385.0 remote-wsl|ms-|0.88.2 extension-test-runner|ms-|0.0.12 vscode-selfhost-test-provider|ms-|0.3.25 vscode-yaml|red|1.15.0 fugio|Tyl|0.0.7
A/B Experiments ``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vswsl492cf:30256198 vscod805:30301674 vsaa593:30376534 py29gd2263:31024238 c4g48928:30535728 vscrpc:30624061 962ge761:30841072 pythongtdpath:30726887 welcomedialog:30812478 pythonnoceb:30776497 asynctok:30898717 dsvsc014:30777825 dsvsc015:30821418 pythonmypyd1:30859725 h48ei257:31000450 pythontbext0:30879054 accentitlementst:30870582 dsvsc016:30879898 dsvsc017:30880771 dsvsc018:30880772 cppperfnew:30980852 pythonait:30973460 945dj816:31013170 a69g1124:31018687 dvdeprecation:31040973 dwnewjupytercf:31046870 nb_pkg_only:31057982 nativerepl1:31134653 refactort:31084545 pythonrstrctxt:31093868 flighttreat:31119334 wkspc-onlycs-t:31132770 nativeloc1:31118317 wkspc-ranged-c:31125598 3ad50483:31111987 jh802675:31132134 e80f6927:31120813 fje88620:31121564 ```
bwateratmsft commented 1 week ago

/cc @isidorn

justschen commented 1 week ago

atm it's doing something different than the internal reporting we have for microsoft contributors. i believe we had some internal conversation on what information we want to include but nothing concrete since it's relatively new. maybe rob can speak on that?

when reporting internally, you can try this tho, which will add a report button next to the thumbs down

  "github.copilot.advanced": {
    "debug.reportFeedback" : true
   }

cc @roblourens

roblourens commented 1 week ago

Yeah, we should use that somehow. I don't fully understand how that menu contribution works though. @justschen is there a doc/issue/sample I can look at?

justschen commented 1 week ago

@roblourens in this case, i don't think you need to contribute the menu contribution, since we know it's coming from a specific menu, and is going to specifically be copilot chat.

the menu contribution is for the full help flow (help -> report issue -> select type of bug -> select extension -> populates data) which we don't really need for copilot chat.

the feedback reporter does this by adding a data field when the button is pressed:

    private async _reportIssue(title: string, body: string) {
        await vscode.commands.executeCommand('workbench.action.openIssueReporter', {
            extensionId: EXTENSION_ID,
            issueTitle: title,
            data: body, // <--------- this adds the "additional data" field
            issueBody: '',
        });
    }

edit: seems like we specifically want to add some custom data here, which is a bit trickier. this is the doc, and python and python debugger utilize this atm -> https://github.com/microsoft/vscode-python/blob/08e7fdfeebec42720c9b4f012c1502efc6ef8aed/src/client/common/application/commands/reportIssueCommand.ts#L45

roblourens commented 1 week ago

I think the request here is for the other way around- if another extension already registered a command for that menu, then we should respect that in this menu.

So the expectation is that if an extension registers a command to contribIssueReporter, then that command should call executeCommand('workbench.action.openIssueReporter' with its own custom data?

If so, then from vscode I would have to know that this extension contributed a command to a particular menu, look up that command, and execute it when this submenu item is selected. I don't think there's a straightforward way for us to know that a menu contribution came from a particular extension, which makes this a little tricky, but it should be possible somehow.

bwateratmsft commented 1 week ago

I think the request here is for the other way around- if another extension already registered a command for that menu, then we should respect that in this menu.

Yeah, that's the ultimate goal. We want to be able to inject data into the Issue Reporter form regardless of where the user initiates the Report Issue flow.