microsoft / vscode-copilot-release

Feedback on GitHub Copilot Chat UX in Visual Studio Code.
https://marketplace.visualstudio.com/items?itemName=GitHub.copilot-chat
Creative Commons Attribution 4.0 International
310 stars 28 forks source link

Copilot is fails to get code context while explaining #1414

Open phalgunvaddepalli opened 1 month ago

phalgunvaddepalli commented 1 month ago

GitHub Copilot Chat

Network

User Settings:

  "github.copilot.advanced": {
    "debug.useElectronFetcher": true,
    "debug.useNodeFetcher": true
  }

DNS Lookup api.githubcopilot.com: 140.82.113.22

Fetching https://api.githubcopilot.com/_ping:

I am using Github Copilot chat for Angular code. There is a observable pipeline code which is 316 lines long. When I select the whole observable pipeline and ask Copilot to explain it is unable to do so. I have listed 2 scenarios where the code is selected and copilot is unable to process the selected context.

Scenario#1: Message too long

Steps to Reproduce:

  1. Select the long piece of code of 316 lines manually in VS Code.
  2. Right click-> Copilot->Explain This.
  3. Copilot says Sorry, this message is too long. Please try a shorter question.

Scenario#2: Responds with generic information, not related to context

-Logs: 2024-07-22 05:24:02.742 [info] [chat fetch] request.response: [https://api.githubcopilot.com/chat/completions], took 1259 ms 2024-07-22 05:24:18.276 [info] [streamMessages] message 0 returned. finish reason: [stop] 2024-07-22 05:24:18.277 [info] [streamChoices] request done: requestId: [93a9a551-0c19-4b50-82ea-e9c7267837b3] model deployment ID: [] 2024-07-22 05:24:19.949 [info] [chat fetch] request.response: [https://api.githubcopilot.com/chat/completions], took 822 ms 2024-07-22 05:24:20.052 [info] [streamMessages] message 0 returned. finish reason: [stop] 2024-07-22 05:24:20.052 [info] [streamChoices] request done: requestId: [25d651a2-cc43-45ec-87a0-7e7f2d40f83d] model deployment ID: []

Steps to Reproduce:

  1. Whist in middle of a long observable pipeline code, right click and select Copilot->Explain This.
  2. Copilot prompts to select "Select an enclosing range to explain", select the whole observable stream of 316 lines.
  3. Copilot says that specific section of code was not provided and the responds with unrelated generic information.

image

fisforfaheem commented 1 month ago

This issue is happening to me as well, on latest stable versions, also it seems to give wrong answers for flutter SDK

wusskk commented 1 month ago

Copilot is unable to read code that exceeds 100 lines, whether using /explain or /fix.

It cannot read the code I provided.