continue icon indicating copy to clipboard operation
continue copied to clipboard

Intermittent Copy/Paste Not Working and Extension Host Crashes in VSCode [specifically for `.sh` files]

Open topolittle opened this issue 1 year ago • 79 comments

Before submitting your bug report

Relevant environment info

- VSCode: 1.96.3
- Continue: 0.8.66
- OS: Fedora 41 (x11)
- Ollama: 0.5.4
- Model: qwen2.5-coder:7b-instruct-q5_K_S
- NVIDIA Drivers: 565.77
- CUDA: 12.6.85
- Other Enabled Extensions: Bash Debug, Bash IDE, ShellCheck

{
  "models": [
    {
      "title": "Qwen2.5-Coder 7b Chat",
      "provider": "ollama",
      "model": "qwen2.5-coder:7b-instruct-q5_K_S"
    }
  ],
  "tabAutocompleteModel": {
    "title": "Qwen2.5-Coder 7b Autocomplete",
    "provider": "ollama",
    "model": "qwen2.5-coder:7b-instruct-q5_K_S"
  },
  "useLegacyCompletionsEndpoint": false,
  "completionOptions": {
    "keepAlive": 900,
    "maxTokens": 2048
  },
    "contextProviders": [
    {
      "name": "code",
      "params": {}
    },
    {
      "name": "docs",
      "params": {}
    },
    {
      "name": "diff",
      "params": {}
    },
    {
      "name": "terminal",
      "params": {}
    },
    {
      "name": "problems",
      "params": {}
    },
    {
      "name": "folder",
      "params": {}
    },
    {
      "name": "codebase",
      "params": {}
    }
  ],
  "slashCommands": [
    {
      "name": "share",
      "description": "Export the current chat session to markdown"
    },
    {
      "name": "cmd",
      "description": "Generate a shell command"
    },
    {
      "name": "commit",
      "description": "Generate a git commit message"
    }
  ]
}

Description

After using the Continue VSCode extension for a few minutes, the Copy/Paste functionality stops working. Additionally, when this happens, the ShellCheck extension begins displaying false syntax errors.

I primarily use the Continue extension for tab auto-completion in shell scripts.

Troubleshooting Steps Tried (No Success):

  • Updated the OS to the latest version.
  • Disabled all extensions except Continue
  • Disabled the code indexing
  • Updated VSCode to the latest version.
  • Switched to the pre-release version of the Continue extension.
  • Tested previous versions of the extension (0.8.65, 0.8.63, 0.8.61).

Unfortunately, the issue is so disruptive that I’ve had to disable the Continue extension entirely. When the extension is disabled, VSCode works perfectly, and I encounter no issues.

Is’t so annoying that I have to stop using the extension. With the Continue extension disabled, VSCode is working fine and I don’t experience any issues.

Note that this occurs only when actively using the extension (e.g.: editing a file). The problem doesn't occurs by itself when VSCode is left open overnight.

To reproduce

  1. Enable and configure the extension in VSCode for tab autocomplete and normal model
  2. Edit a shell script (.sh)
  3. After a few minutes of active editing, copy and paste become unresponsive

Log output

**Window:*
[info] Extension host (LocalProcess pid: 336281) is unresponsive.
[info] UNRESPONSIVE extension host: starting to profile NOW
[error] Error: Aborted onWillSaveTextDocument-event after 1750ms

**Extension Host:**
[error] TypeError: Cannot read properties of undefined (reading 'apply')
	at e4.<computed> (/home/sgilbert/.vscode/extensions/continue.continue-0.8.66-linux-x64/out/extension.js:109650:63)
	at wasm://wasm/0055765a:wasm-function[15]:0x29b5
	at wasm://wasm/000b54aa:wasm-function[234]:0x25635

topolittle avatar Jan 17 '25 15:01 topolittle

I experience the exact same issue. This is really annoying.

When this issue happens it slow down a lot of others commands, like creating new file, deleting files, etc. Even saving a file takes 2 to 3 seconds...

Maybe dup of #3751

damajor avatar Jan 19 '25 01:01 damajor

It happens also with pre-release version of the extension.

Extension logs:

2025-01-19 16:01:24.310 [error] TypeError: Cannot read properties of undefined (reading 'apply')
	at e4.<computed> (/****/com.visualstudio.code/data/vscode/extensions/continue.continue-0.9.252-linux-x64/out/extension.js:110752:63)
	at wasm://wasm/0055765a:wasm-function[15]:0x29b5
	at wasm://wasm/000b54aa:wasm-function[234]:0x25635
	at _Parser.parse (/****/com.visualstudio.code/data/vscode/extensions/continue.continue-0.9.252-linux-x64/out/extension.js:111425:30)
	at _ImportDefinitionsService._getFileInfo (/****/com.visualstudio.code/data/vscode/extensions/continue.continue-0.9.252-linux-x64/out/extension.js:112546:28)
	at async PrecalculatedLruCache.initKey (/****/com.visualstudio.code/data/vscode/extensions/continue.continue-0.9.252-linux-x64/out/extension.js:110280:26)

damajor avatar Jan 19 '25 18:01 damajor

I went back to 0.8.60 testing ALL versions in between. All versions (except 0.8.60) crashed resulting with the same behavior by disabling copy (ctrl-c) and impacting other extensions as well.

The 0.8.60 also crashed and other extensions are also prevented to work but copy still work, here is the logs for 0.8.60 crash:

2025-01-20 17:56:54.074 [error] RangeError: path should be a `path.relative()`d string, but got "../../../.continue/config.json"
	at throwError (/*****/com.visualstudio.code/data/vscode/extensions/continue.continue-0.8.60/out/extension.js:71825:13)
	at checkPath (/*****/com.visualstudio.code/data/vscode/extensions/continue.continue-0.8.60/out/extension.js:71839:16)
	at Ignore2._test (/*****/com.visualstudio.code/data/vscode/extensions/continue.continue-0.8.60/out/extension.js:71927:9)
	at Ignore2.ignores (/*****/com.visualstudio.code/data/vscode/extensions/continue.continue-0.8.60/out/extension.js:71954:21)
	at (/*****/com.visualstudio.code/data/vscode/extensions/continue.continue-0.8.60/out/extension.js:541456:31
2025-01-20 17:56:55.450 [error] TypeError: Cannot read properties of undefined (reading 'apply')
	at e3.<computed> (/*****/com.visualstudio.code/data/vscode/extensions/continue.continue-0.8.60/out/extension.js:85639:63)
	at wasm://wasm/0055765a:wasm-function[15]:0x29b5
	at wasm://wasm/000b54aa:wasm-function[234]:0x25635
	at _Parser.parse (/*****/com.visualstudio.code/data/vscode/extensions/continue.continue-0.8.60/out/extension.js:86312:29)
	at _ImportDefinitionsService._getFileInfo (/*****/com.visualstudio.code/data/vscode/extensions/continue.continue-0.8.60/out/extension.js:87292:28)
	at async PrecalculatedLruCache.initKey (/*****/com.visualstudio.code/data/vscode/extensions/continue.continue-0.8.60/out/extension.js:85170:25)

I continue to test but this is getting really annoying.

damajor avatar Jan 20 '25 17:01 damajor

We're looking into the copy issue this week - I'm uncertain if it will resolve the Cannot read properties of undefined (reading 'apply') issue you are having but our hunch is that the copy issue is related to general indexing bottlenecks so it's possible it will also resolve this.

Patrick-Erichsen avatar Jan 20 '25 22:01 Patrick-Erichsen

I would like to add that when the following info/error messages occur, the Continue extension stops working; no more tab autocomplete. But if I kill the process, run0 kill -9 462689, the extension is working again as well as the copy and paste.

2025-01-21 08:08:28.794 [info] Extension host (LocalProcess pid: 462689) is unresponsive.
2025-01-21 08:08:30.438 [info] UNRESPONSIVE extension host: starting to profile NOW
2025-01-21 08:08:47.646 [error] Error: Aborted onWillSaveTextDocument-event after 1750ms
    at vscode-file://vscode-app/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:767:9409

topolittle avatar Jan 21 '25 13:01 topolittle

I noticed the same issue. To be exact: Only "Copy" stops working, either via CTRL+C or edit->copy menu in that it doesn't copy anything although it doesn't indicate anything (wrong or right). Pasting does work but as the clipboard doesn't get updated it just pastes what had been successfully copied "ages" ago.

As for Cannot read properties of undefined (reading 'apply') see my comment on a (seemingly) unrelated issue

Flamefire avatar Jan 23 '25 08:01 Flamefire

I wonder if this happens only for local models (Ollama) or also with OpenAI and compatible ones.

damajor avatar Jan 23 '25 18:01 damajor

@damajor I'm experiencing this on all models that I use, both local via Ollama and OpenAI compatible.

Patrick-Erichsen avatar Jan 23 '25 18:01 Patrick-Erichsen

I noticed the more completion requests are made the quicker the issue occurs.

damajor avatar Jan 23 '25 19:01 damajor

+1, experiencing the same.

davidalo avatar Jan 25 '25 19:01 davidalo

@RomneyDa is taking a look into the issue this week 👍

Patrick-Erichsen avatar Jan 28 '25 00:01 Patrick-Erichsen

I have noticed the problem occurs only when using tab auto-completion in shell script. However, when using it in python code, the problem doesn't occurs.

topolittle avatar Jan 31 '25 14:01 topolittle

I have noticed the problem occurs only when using tab auto-completion in shell script. However, when using it in python code, the problem doesn't occurs.

I also have noticed that, tomorrow I will try with python and give feedback.

Edit: Worked more than one hour on some python scripts without any issue. Then I opened a bash script (quite large) and it crashed again in less than 15 minutes.

damajor avatar Jan 31 '25 16:01 damajor

Any progress on this issue ?

damajor avatar Feb 05 '25 17:02 damajor

Can confirm, this autocomplete bug appears to only occur with shell scripts. Happy to provide logs! I'm a sysadmin, not a real dev...otherwise I'd volunteer to tackle this one if I could!

ag14spirit avatar Feb 05 '25 21:02 ag14spirit

I've noticed it today in MarkDown files. But before it was also only in shell scripts.

Flamefire avatar Feb 06 '25 07:02 Flamefire

ping

damajor avatar Feb 11 '25 00:02 damajor

I notice that shortly before the issue occurs on my machine, it starts to show some inline progress animation (spinner) when pasting text. As if continue is processing the pasted text before actually pasting it. At the same time CPU load of VS Code increases a lot and pasting takes longer and longer each time. About 30 seconds to 1 minute later, copy/paste is broken as described above.

tobeyfox avatar Feb 11 '25 09:02 tobeyfox

Hi all, we commented out the copy buffer that we think was causing this issue: https://github.com/continuedev/continue/commit/009a0cfc5a10967e0a09607f4f849412bf7647f9

This update is in latest pre-release, 0.9.262, but internally it seems as if we are still having issues with copy/paste. It would be helpful if you all could pull down that version and see if the issue is persisting for yourselves and report back though 👍

Patrick-Erichsen avatar Feb 11 '25 18:02 Patrick-Erichsen

The problem still occurs with pre-release version 0.9.262. After 5 minutes of using tab autocomplete in bash script, the extension host become unresponsive. It's the exact same problem.

Here is the VSCode's Window console log:

2025-02-11-17:02:57.595 [error] [Window] An unknown error occurred. Please consult the log for more details.
2025-02-11-17:03:35.691 [info] [Window] Extension host (LocalProcess pid: 3286138) is unresponsive.
2025-02-11-17:03:37.134 [info] [Window] UNRESPONSIVE extension host: starting to profile NOW

VSCode version:

Version: 1.97.0
Commit: 33fc5a94a3f99ebe7087e8fe79fbe1d37a251016
Date: 2025-02-04T22:41:26.688Z
Electron: 32.2.7
ElectronBuildId: 10660205
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Linux x64 6.12.11-200.fc41.x86_64

topolittle avatar Feb 11 '25 22:02 topolittle