Copilot is fails to get code context while explaining
GitHub Copilot Chat
- Extension Version: 0.17.1 (prod)
- VS Code: vscode/1.91.1
- OS: Windows
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:
- Electron Fetcher (configured): HTTP 200
- Node Fetcher: HTTP 200
- Helix Fetcher: HTTP 200
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
- Logs:
2024-07-22 05:31:12.243 [info] [asyncCompute] Computing async parser based result took longer than 600ms 2024-07-22 05:31:13.714 [info] [extension] Error: Sorry, this message is too long. Please try a shorter question. at Xe.render (c:\Users\pvaddepa\.vscode\extensions\github.copilot-chat-0.17.1\dist\extension.js:780:2956) at bM.buildPrompt (c:\Users\pvaddepa\.vscode\extensions\github.copilot-chat-0.17.1\dist\extension.js:780:2562) at aM._provideResponseWithProgress (c:\Users\pvaddepa\.vscode\extensions\github.copilot-chat-0.17.1\dist\extension.js:872:1757) at aM.provideResponseWithProgress (c:\Users\pvaddepa\.vscode\extensions\github.copilot-chat-0.17.1\dist\extension.js:870:4601) at n.y (c:\Users\pvaddepa\.vscode\extensions\github.copilot-chat-0.17.1\dist\extension.js:882:1826) at g.$invokeAgent (c:\Users\pvaddepa\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:154:50217)
Steps to Reproduce:
- Select the long piece of code of 316 lines manually in VS Code.
- Right click-> Copilot->Explain This.
- 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:
- Whist in middle of a long observable pipeline code, right click and select Copilot->Explain This.
- Copilot prompts to select "Select an enclosing range to explain", select the whole observable stream of 316 lines.
- Copilot says that specific section of code was not provided and the responds with unrelated generic information.
This issue is happening to me as well, on latest stable versions, also it seems to give wrong answers for flutter SDK
Copilot is unable to read code that exceeds 100 lines, whether using /explain or /fix.
It cannot read the code I provided.
This should work as expected now that we have rolled out longer context windows. Please let us know if it still repros.