microsoft / vscode

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

Generating a commit message with Copilot does not work #208688

Closed jaanli closed 1 month ago

jaanli commented 5 months ago
image

Steps to Reproduce:

  1. Install visual studio code with homebrew
  2. Make a commit to a repo
  3. Click on source control
  4. Click on generate a commit message
  5. Nothing happens

Any ideas on how to debug this? Thank you!

lszomoru commented 2 months ago

Sorry for not getting back to you on this until now. Could you please download the latest VS Code Insiders + Copilot Chat pre-release extension as it contains some additional logging that should probably help us track down the root cause of the issue. After you have install VS Code Insiders + Copilot Chat pre-release extension please do the following:

  1. Open the folder/workspace, and make a change
  2. Click the "Generate Commit Message with Copilot" action
  3. In the main menu use View -> Output and share the contents of the "Github Copilot Chat" channel
wChenonly commented 2 months ago

You can take a screenshot of the "Github Copilot Chat" channel first,post it and see

Starfox64 commented 1 month ago

@lszomoru

This seems to happen when one of the following options is disabled in the GitHub settings: image

The response from the API causes a JSON parsing error according to the logs:

2024-07-10 11:01:34.961 [info] [ModelMetadataFetcher] Failed to fetch models, SyntaxError: Unexpected token 'u', "unauthoriz"... is not valid JSON
    at JSON.parse (<anonymous>)
    at t.json (/home/starfox64/.vscode-server/extensions/github.copilot-chat-0.17.2024062801/dist/extension.js:66:28638)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at UA._fetchModels (/home/starfox64/.vscode-server/extensions/github.copilot-chat-0.17.2024062801/dist/extension.js:1317:3403)
    at UA.getEmbeddingsModel (/home/starfox64/.vscode-server/extensions/github.copilot-chat-0.17.2024062801/dist/extension.js:1317:2685)
    at ZT.getEmbeddingsEndpoint (/home/starfox64/.vscode-server/extensions/github.copilot-chat-0.17.2024062801/dist/extension.js:1317:6119)
    at sRe (/home/starfox64/.vscode-server/extensions/github.copilot-chat-0.17.2024062801/dist/extension.js:1115:1436)
    at Kct (/home/starfox64/.vscode-server/extensions/github.copilot-chat-0.17.2024062801/dist/extension.js:1317:7703)
    at c.n (/home/starfox64/.vscode-server/bin/ea1445cc7016315d0f5728f8e8b12a45dc0a7286/out/vs/workbench/api/node/extensionHostProcess.js:146:6384)
    at c.m (/home/starfox64/.vscode-server/bin/ea1445cc7016315d0f5728f8e8b12a45dc0a7286/out/vs/workbench/api/node/extensionHostProcess.js:146:6347)
    at c.l (/home/starfox64/.vscode-server/bin/ea1445cc7016315d0f5728f8e8b12a45dc0a7286/out/vs/workbench/api/node/extensionHostProcess.js:146:5804)

An improvement would be to display a pop up indicating that the feature is disabled in the user's GitHub settings.

lszomoru commented 1 month ago

@lramos15, do you mind taking a look at this? Thank you!

lramos15 commented 1 month ago

A UI piece has been added and will be present in the next release. Thanks for reporting!