twinnydotdev / twinny

The most no-nonsense, locally or API-hosted AI code completion plugin for Visual Studio Code - like GitHub Copilot but completely free and 100% private.
https://twinny.dev
MIT License
3.12k stars 166 forks source link

Infinite loading of FIM when in remote VSCode(SSH) having opened unsaved interactive Jupyter tab. #310

Open AndrewRocky opened 2 months ago

AndrewRocky commented 2 months ago

Describe the bug I'm using VSCode from a Windows machine connected to Linux via SSH. When there is an unsaved Interactive Jupyter window in the tabs list - Twinny gets stuck on autocomplete (in ALL tabs).

To Reproduce

  1. When in SSH remote window (not sure if this is important)
  2. Open Interactive Jupyter window (extension: https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter) - Command Pallete -> Jupyter: Create Interactive Window
  3. Go to any other tab and start typing (to trigger FIM)
  4. FIM doesn't stop loading (gets an error in logs)

Expected behavior FIM to work properly. (Maybe it should ignore the file that triggers an error?)

Logging

  ERR cannot open vscode-remote://attached-container%2B7b22636f6e7461696e65724e616d65223a222f6a757079746572227d@ssh-remote%2Bc590/Interactive-1.interactive. Detail: Unable to read file 'vscode-remote://attached-container+7b22636f6e7461696e65724e616d65223a222f6a757079746572227d@ssh-remote+c590/Interactive-1.interactive' (Error: Unable to resolve nonexistent file 'vscode-remote://attached-container+7b22636f6e7461696e65724e616d65223a222f6a757079746572227d@ssh-remote+c590/Interactive-1.interactive'): CodeExpectedError: cannot open vscode-remote://attached-container%2B7b22636f6e7461696e65724e616d65223a222f6a757079746572227d@ssh-remote%2Bc590/Interactive-1.interactive. Detail: Unable to read file 'vscode-remote://attached-container+7b22636f6e7461696e65724e616d65223a222f6a757079746572227d@ssh-remote+c590/Interactive-1.interactive' (Error: Unable to resolve nonexistent file 'vscode-remote://attached-container+7b22636f6e7461696e65724e616d65223a222f6a757079746572227d@ssh-remote+c590/Interactive-1.interactive')
    at o.$tryOpenDocument (vscode-file://vscode-app/c:/Users/edited/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:2460:132808)

API Provider oobabooga

Chat or Auto Complete? FIM (auto complete)

Model Name starcoder2-15b

Desktop (please complete the following information):

Additional context Chat works normally though (without embeddings - their provider has always been broken for me)

FanaticPythoner commented 2 months ago

Same issue for me. Ollama.

AndrewRocky commented 2 months ago

Additional very similar issue: Same behavior when there is an unsaved .yaml from Kubernetes extension in tabs (extension ms-kubernetes-tools.vscode-kubernetes-tools).

How to reproduce

1) With Twinny: File Context Enabled > True 2) In Kubernetes extension open any object's YAML (using button 'Load' in context menu): {6747DC31-1230-4C34-A8AA-C39AF0C839CC} 3) It will open tab like this: {38E59F7A-E7FF-4274-9DE7-2E0C2CB6B38A} 4) Without saving that YAML go to another tab and start typing something - FIM loading won't stop.

Suggestion

Can we just ignore files that cannot be opened?