continuedev / continue

⏩ Continue is the leading open-source AI code assistant. You can connect any models and any context to build custom autocomplete and chat experiences inside VS Code and JetBrains
https://docs.continue.dev/
Apache License 2.0
19.52k stars 1.69k forks source link

"Unable to resolve filesystem provider" in devcontainer #517

Open amihalik opened 1 year ago

amihalik commented 1 year ago

Before submitting your bug report

Relevant environment info

- OS: windows host, mcr.microsoft.com/devcontainers/python:1-3.11-bullseye devcontainer
- Continue: v0.0.403

Description

It seems like commands like /comment don't know where my files are when I'm working in a dev container. For instance, I tried to add comments to a file config.py in my project, and I got these errors in the Developer Tool:

[Extension Host] Error listing directory contents:  Error (FileSystemError): Unable to resolve filesystem provider with relative file path 'vscode-remote://dev-container\workspaces\continue-deploy'
    at k.e (c:\Users\---------\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:109:27846)
    at Object.readDirectory (c:\Users\---------\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:109:24745)
    at async IdeProtocolClient.getDirectoryContents (c:\Users\---------\.vscode\extensions\continue.continue-0.0.403\out\extension.js:67780:28)
    at async IdeProtocolClient.handleMessage (c:\Users\---------\.vscode\extensions\continue.continue-0.0.403\out\extension.js:67569:26)
Error handling message (showDiff) from Continue server: Unable to resolve filesystem provider with relative file path 'vscode-remote://dev-container\tmp\continue\$backslash$workspaces$backslash$continue-deploy$backslash$config.py'
c @ notificationsAlerts.ts:42

To reproduce

Here's an clean example on a new project:

  1. Create a new VS code window (ctrl + shift + n)
  2. Connect to a new dev container (ctrl + alt + o, "New Dev Container")
  3. Select "Python 3" devcontainer
  4. Select "Create Dev Container" (wait for dev container to load)
  5. Validate Continue still works (i.e. ctrl + shift + l, "foo bar", verify output LLM output is in the continue view)
  6. Create a new file (eg. "hello_world.py", print('hello world'))
  7. Add the code to continue (ctrl + a, ctrl + shift +m) and run /comment
  8. Notice lots of flashing errors in the lower right of vscode
  9. Open developer tools, notice errors like:
Error handling message (showDiff) from Continue server: Unable to resolve filesystem provider with relative file path 'vscode-remote://dev-container\tmp\continue\$backslash$workspaces$backslash$python-2$backslash$hello_world.py'
c @ workbench.desktop.main.js:sourcemap:765
Extension Host] Error listing directory contents:  Error (FileSystemError): Unable to resolve filesystem provider with relative file path 'vscode-remote://dev-container\workspaces\python-2'
    at k.e (c:\Users\1111\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:109:27846)
    at Object.readDirectory (c:\Users\11111\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:109:24745)
    at async IdeProtocolClient.getDirectoryContents (c:\Users\1111\.vscode\extensions\continue.continue-0.0.403\out\extension.js:67780:28)
    at async IdeProtocolClient.handleMessage (c:\Users\1111\.vscode\extensions\continue.continue-0.0.403\out\extension.js:67569:26)

Log output

No response

sestinj commented 1 year ago

I see the general problem here - we're checking the OS of the host when deciding whether to format paths with forward or backslashes, and the host is Windows, so sends paths with the wrong separator. I'd assume these paths exist if given the correct separator (in the Debian container).

Mostly a note to myself, but the requirement to solve this is just finding a reliable way of determining the OS of the dev container or remote machine (vscode.workspace.fs doesn't seem to provide anything out-of-the-box). I'll give this a short tmr

hgw77 commented 1 year ago

I have a similar problem. I use CodeServer. When I try /edit write a bash script same happens but with a different error message that leads I guess to the same problem

error handling message (showDiff) from Continue server: Error (FileSystemError): Unable to resolve filesystem provider with relative file path 'vscode-remote://cs.dev.treehouse.corpremoteagent'

cs.dev.treehouse.corp is the remote host in my local network where the code-server is running

gemmell commented 10 months ago

I note $backslash in the error there: 'vscode-remote://dev-container\tmp\continue\$backslash$workspaces$backslash$python-2$backslash$hello_world.py'

Could it be this is a solved problem and you just need to use $backslash instead of \?

gemmell commented 10 months ago

@sestinj , the above message was meant for you. It seems there is already something at play that distinguishes which backslash to use (possibly provided by vscode), can you just use $backslash instead of doing the hard work of reliably determining the OS of the dev container or remote OS?

sestinj commented 10 months ago

@gemmell very sorry I missed this! The "$backslash" here was replaced with "f" or "b" in more recent versions, the relevant code being here, and we made a number of related fixes in just the last few weeks. Is this still happening for you on latest versions? If so, what's the best way for me to set up an environment like yours to reproduce?

Extremys commented 8 months ago

Hello team, are you officially supporting CodeServer? Thanks