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
324 stars 29 forks source link

Copilot response cuts off prematurely #303

Closed DanSoQt closed 1 year ago

DanSoQt commented 1 year ago

Copilot seems to be unable to spit out more than a few lines when asked to "adapt" some code. Other prompts like "help me update my code" produce the same cut-off responses.

Steps to Reproduce:

  1. Ask Copilot Chat to "adapt" a given open file. The request doesn't matter, but the issue was found asking it to adapt a ~110 line python file to switch to using urllib instead of 'requests'.
  2. Copilot obliges and get through about 15 lines or so (variable) before simply stopping or even dropping out before completing formatting.

Example request: "Please adapt my code in [filename] to use urllib requests and error handling instead of the 'requests' library."

Response:

Certainly! Here's an updated version of the code that uses urllib requests and error handling:

\```python import sys import json import logging import re import base64 import argparse from os import environ as envs from urllib.parse import unquote, quote from urllib.request import Request, urlopen from urllib.error import HTTPError, URLError
JacobCallahan commented 1 year ago

I'm seeing the same behavior as well. It seems like it will get stuck after it finishes import statements, no matter how short that import list is. When this happens, additional prompting will result in an apology and no correction of the output.

Is this more an issue with rate limiting?

Citizen-Dan commented 1 year ago

I am seeing the same issue too. When asked a question without the need for code in the response, the answers do seem complete. However when any code is required, it stops on the first line.

DanSoQt commented 1 year ago

I don’t think it’s a rate-limiting issue, or at least I’m not familiar with those limits. The logs for the request only show three streamMessages events pertaining to the question, and it occurred the first time I asked chat a question.

Neural-Net-Ninja commented 1 year ago

instead of whole code, it just imports a library needed and that's it.

roblourens commented 1 year ago

Is this file open and do you have a selection in it? I think there is an issue with missing editor context here. And if the file is not open, chat can't see it.

DanSoQt commented 1 year ago

Yes, the file is open and the active tab in the editor. I'll do some further testing tomorrow to see if other prompts are able to grab the appropriate context or not.

As far as selection goes, no selection, but the file is just over 100 lines, and the filename is provided in the prompt.


From: Rob Lourens @.> Sent: Wednesday, July 5, 2023 7:07:46 PM To: microsoft/vscode-copilot-release @.> Cc: Daniel Smith @.>; Author @.> Subject: Re: [microsoft/vscode-copilot-release] Copilot response cuts off prematurely (Issue #303)

Is this file open and do you have a selection in it? I think there is an issue with missing editor context here. And if the file is not open, chat can't see it.

— Reply to this email directly, view it on GitHubhttps://github.com/microsoft/vscode-copilot-release/issues/303#issuecomment-1622161072, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJGGXPQ5LIUQEXWJM2HYOMTXOWNOFANCNFSM6AAAAAAZ64OVCQ. You are receiving this because you authored the thread.Message ID: @.***>

roblourens commented 1 year ago

Can someone try installing a previous version of the Copilot Chat extension to see whether it regressed in the past couple days

Neural-Net-Ninja commented 1 year ago

Can someone try installing a previous version of the Copilot Chat extension to see whether it regressed in the past couple days

it's working fine with the old version!

roblourens commented 1 year ago

Which version?

Neural-Net-Ninja commented 1 year ago

Which version?

so it caused this problem on 0.2.2 and went I went to 0.2.1 it worked fine.

roblourens commented 1 year ago

@ulugbekna I think this is https://github.com/microsoft/vscode-copilot/commit/ca37a063d374113c0247e54a158520495a876cb0

BoringApp commented 1 year ago

I met same problem since yesterday.

GitHub Copilot Version: v1.95.239 GitHub Copilot Chat: v0.3.2023070401 Visual Studio Code - Insiders Version:

Version: 1.80.0-insider
Commit: 660393deaaa6d1996740ff4880f1bad43768c814
Date: 2023-07-04T11:01:44.989Z (1 day ago)
Electron: 22.3.14
ElectronBuildId: 21893604
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Darwin arm64 22.5.0

OS: macOS Ventura 13.4

image
ChiragBusiness commented 1 year ago

Think i was only getting the error when it was trying to output a code block, switched to a version from a week ago and it works fine

alexdima commented 1 year ago

Appologies for the breakage. We have shipped a new prerelease version of the extension, v0.3.2023070602 which should contain a fix.

DanSoQt commented 1 year ago

Unfortunately, I'm still experiencing the same issue in v0.3.2023070602. Updated extensions this morning and restarted VS Code Insiders for good measure. The behavior appears identical. When copilot begins to write a code-block, it bombs out and fails to complete the thought. Are there any caches I can/should clear to ensure the I'm not somehow still using a cached library?

Here's an example of how you can adapt the code to use built-in libraries instead of the 'requests' library:
```python import urllib.request import urllib.parse import base64

GitHub Copilot Chat version v0.3.2023070602 Last updated 7/6/2023, 11:23:11 (UTC+1)

GitHub Copilot version v1.95.240 Last updated 7/6/2023, 11:18:33

alexdima commented 1 year ago

@DanSoQt You're right, sorry again about that 😳 ! Version v0.3.2023070603 should contain a fix.

DanSoQt commented 1 year ago

Confirmed working as expected in v0.3.2023070603. Thanks for the fix!