vscode-copilot-release icon indicating copy to clipboard operation
vscode-copilot-release copied to clipboard

Invalid Gap

Open salientknight opened this issue 1 year ago • 24 comments

  • VS Code Version: 1.88.0-insider (Universal)
  • OS Version: Soma 14.4 (23E214)
  • Logs:

Steps to Reproduce:

  1. highlight a block of text
  2. use the inline chat feature

results invalid Gap Expected results: Code suggestions Screenshot 2024-03-14 at 11 00 22 AM

I just started using this feature last Friday and it stopped working Monday.

salientknight avatar Mar 14 '24 15:03 salientknight

@salientknight Can you consistently reproduce this error? What programming language have you used? This is caused by some AST processing we are doing, so it might be reproducible only with certain code structure.

alexdima avatar Mar 27 '24 14:03 alexdima

for me its on every instance of inline chat

language used is dart

on vscode

ash199909 avatar Apr 08 '24 06:04 ash199909

Same issue here since today, using PowerShell in VS Code. 'Invalid gap' error appears both when selecting a segment of code and while not having anything selected.

image

image

Skwie avatar Apr 08 '24 09:04 Skwie

same here, "invalid gap" in inline chat in solidity, 100% reproducible.

egorFiNE avatar Apr 08 '24 12:04 egorFiNE

I have the same error "invalid gap" trying to get any response in php when asking to generate code. It does /explain just fine.

I opened a separate project written in C++, asked Co-Pilot to generate code, it did fine. Went back into the php project, it was able to generate code for me again.

🤷‍♂️

netkruzer avatar Apr 09 '24 19:04 netkruzer

Same problem. PHP. For example I mark some code, pressed ctrl+i to ask copilot something... returns invalid gap error only.

Just like the screenshot above from skwie,

seodevse avatar Apr 11 '24 08:04 seodevse

is this solved for anyone

ash199909 avatar Apr 12 '24 07:04 ash199909

is this solved for anyone

Updated plugins and removed some, restarted everything, so for all good.

seodevse avatar Apr 12 '24 07:04 seodevse

is this solved for anyone

Updated plugins and removed some, restarted everything, so for all good.

which OS are you using

ash199909 avatar Apr 12 '24 07:04 ash199909

我的问题也是一样的,请问各位解决了吗?

JisiLiu avatar Apr 15 '24 02:04 JisiLiu

@alexdima yes I get this error 100% of the time when trying to use the inline based chat feature

salientknight avatar Apr 15 '24 13:04 salientknight

Got this error today Screenshot 2024-04-16 at 4 05 21 PM

picard102 avatar Apr 16 '24 20:04 picard102

As a workaround, I switched to Preview Mode in the config, and it's generating results again.

It must be an issue with inlining live results (or three million other possibilities)

image

jrmybtlr avatar Apr 17 '24 06:04 jrmybtlr

@alexdima yes I get this error 100% of the time when trying to use the inline based chat feature

Same here

qedric avatar Apr 18 '24 20:04 qedric

Same here, microsoft's team should fix this ASAP.

MTDickens avatar Apr 20 '24 12:04 MTDickens

With Googles Copilot here now and that Cursor IO, wow tired of paying for stuff like this

adamseoul avatar Apr 21 '24 11:04 adamseoul

same here, qml and python

Pauline1910 avatar Apr 21 '24 16:04 Pauline1910

As a workaround, I switched to Preview Mode in the config, and it's generating results again.

It must be an issue with inlining live results (or three million other possibilities)

image

Thanks but that did not help me, I get exactly the same problem even after rebooting. Cursor switched!

adamseoul avatar Apr 22 '24 09:04 adamseoul

I have found a temporary fix, nothing else anyone has suggested has worked, however it seems typing whatever it is you want to query and then doing /fix retains the message from before... Odd but it works

YeahJenni avatar Apr 23 '24 03:04 YeahJenni

/fix method mentioned above solved the problem for me.

alexdong avatar May 02 '24 23:05 alexdong

Also having this problem anytime I ask Copilot for inline fixes with PHP

kevin-j-morse avatar May 05 '24 06:05 kevin-j-morse

Same issue as other people and I am using nuxt 3 / vue 3

AhmadMraish avatar May 05 '24 20:05 AhmadMraish

/fix method mentioned above solved the problem for me.

Not sure how you are using this /fix

AhmadMraish avatar May 05 '24 23:05 AhmadMraish

/fix method mentioned above solved the problem for me.

Not sure how you are using this /fix

Simply writing your request, and then after getting Invalid Gap running /fix.

YeahJenni avatar May 05 '24 23:05 YeahJenni

Also having this problem anytime I ask Copilot for inline fixes with PHP

Started getting the same today. Also with PHP (it was working fine and then just decided to start giving me "Invalid gap" with each response (not sure it's related to a change in my code or something on the CoPilot end - it seems like it should work based on how I have been using it...)

mulderpf avatar May 16 '24 07:05 mulderpf

Started getting this yesterday when doing HTML. image

Diagnostics: `## Copilot

  • Version: 1.192.0
  • Build: prod
  • Editor: vscode/1.89.0

Environment

  • http_proxy: n/a
  • https_proxy: n/a
  • no_proxy: n/a
  • SSL_CERT_FILE: n/a
  • SSL_CERT_DIR: n/a
  • OPENSSL_CONF: n/a

Feature Flags

  • Send Restricted Telemetry: disabled
  • Chat: enabled

Node setup

  • Number of root certificates: 141
  • Operating system: Darwin
  • Operating system version: 23.3.0
  • Operating system architecture: arm64
  • NODE_OPTIONS: n/a
  • NODE_EXTRA_CA_CERTS: n/a
  • NODE_TLS_REJECT_UNAUTHORIZED: n/a
  • tls default min version: TLSv1.2
  • tls default max version: TLSv1.3

Network Configuration

  • Proxy host: n/a
  • Proxy port: n/a
  • Kerberos SPN: n/a
  • Reject unauthorized: disabled
  • Fetcher: HelixFetcher

Reachability

  • github.com: HTTP 200
  • copilot-proxy.githubusercontent.com: HTTP 200
  • api.githubcopilot.com: HTTP 200
  • default.exp-tas.com: HTTP 200

VS Code Configuration

  • HTTP proxy:
  • HTTP proxy authentication: n/a
  • Proxy Strict SSL: true
  • Extension HTTP proxy support: override

Extensions

  • Is win-ca installed?: false
  • Is mac-ca installed?: false

Authentication

  • GitHub username: Klievan`

Logs when receiving "Invalid gap" 2024-05-16 14:16:21.782 [info] [streamChoices] request done: requestId: [bc41d69e-ea02-4e92-93b9-f5b8113e9db3] model deployment ID: [z4dff5e5d11fc] 2024-05-16 14:18:21.042 [info] [chat fetch] url https://api.githubcopilot.com/chat/completions 2024-05-16 14:18:21.042 [info] [chat fetch] modelMaxPromptTokens 7168 2024-05-16 14:18:21.042 [info] [chat fetch] modelMaxResponseTokens 4096 2024-05-16 14:18:21.042 [info] [chat fetch] chat model gpt-3.5-turbo 2024-05-16 14:18:22.013 [info] [chat fetch] request.response: [https://api.githubcopilot.com/chat/completions], took 969 ms 2024-05-16 14:18:22.016 [info] [streamMessages] message 0 returned. finish reason: [stop] 2024-05-16 14:18:22.018 [info] [streamChoices] request done: requestId: [f857958d-a757-4d62-bcf2-9d23d152ae48] model deployment ID: [z4dff5e5d11fc] 2024-05-16 14:22:04.839 [info] [chat fetch] url https://api.githubcopilot.com/chat/completions 2024-05-16 14:22:04.839 [info] [chat fetch] modelMaxPromptTokens 7168 2024-05-16 14:22:04.839 [info] [chat fetch] modelMaxResponseTokens 4096 2024-05-16 14:22:04.839 [info] [chat fetch] chat model gpt-3.5-turbo 2024-05-16 14:22:06.071 [info] [chat fetch] request.response: [https://api.githubcopilot.com/chat/completions], took 1230 ms 2024-05-16 14:22:06.072 [info] [streamMessages] message 0 returned. finish reason: [stop] 2024-05-16 14:22:06.073 [info] [streamChoices] request done: requestId: [aea7ade9-2636-44e7-befa-502c00ad0d9c] model deployment ID: [z4dff5e5d11fc]

Logs when doing /fix (which does work) 2024-05-16 14:22:06.073 [info] [streamChoices] request done: requestId: [aea7ade9-2636-44e7-befa-502c00ad0d9c] model deployment ID: [z4dff5e5d11fc] 2024-05-16 14:23:36.471 [info] [chat fetch] url https://api.githubcopilot.com/chat/completions 2024-05-16 14:23:36.472 [info] [chat fetch] modelMaxPromptTokens 7168 2024-05-16 14:23:36.472 [info] [chat fetch] modelMaxResponseTokens 4096 2024-05-16 14:23:36.472 [info] [chat fetch] chat model gpt-3.5-turbo 2024-05-16 14:23:37.104 [info] [chat fetch] request.response: [https://api.githubcopilot.com/chat/completions], took 631 ms 2024-05-16 14:23:40.861 [info] [streamMessages] message 0 returned. finish reason: [client-trimmed] 2024-05-16 14:23:40.862 [info] [streamChoices] request done: requestId: [160dfc89-55f5-41bd-ad7c-a1c51fc8d015] model deployment ID: [z4dff5e5d11fc] 2024-05-16 14:23:40.868 [info] [editGeneration] Diff metrics: { "diffToEntireScore": { "equalCharCount": 1046, "originalCharCount": 2574, "modifiedCharCount": 1464, "originalCharRatio": 0.4063714063714064, "modifiedCharRatio": 0.7144808743169399 }, "diffToRangeScore": { "equalCharCount": 0, "originalCharCount": 0, "modifiedCharCount": 1464, "originalCharRatio": 0, "modifiedCharRatio": 0 } } 2024-05-16 14:23:40.868 [info] [editGeneration] (case 3) Replacing entire code

Klievan avatar May 16 '24 12:05 Klievan

This reproduces in a .txt file with the content:

if(something) {
    console.log(`something`)
} else {
    console.log(`!something`);
}
    console.log(`a line`);

alexdima avatar May 16 '24 15:05 alexdima

I got the same error when I input "/@workspace /tests" for my C code. I want to generate test case for specified functions. "@workspace generate test case " and "/tests generate test case" is OK to me.

brucewang-wnc avatar May 17 '24 01:05 brucewang-wnc

A fix is now available in the Pre-Release version of the Copilot Chat Extension (v0.16.2024051701 (pre-release)). This is compatible with VS Code Insiders. We plan to make a fix available to the Release version on Monday.

alexdima avatar May 17 '24 10:05 alexdima