fix: tell models the workspace root so filesystem tools work on remote setups - #13096
Open
bunnysayzz wants to merge 1 commit into
Open
fix: tell models the workspace root so filesystem tools work on remote setups#13096bunnysayzz wants to merge 1 commit into
bunnysayzz wants to merge 1 commit into
Conversation
…e setups Models were told to use filesystem tools relative to the workspace root but never given the root itself, so they guessed paths like C:\workspace. On Remote-SSH / Dev Containers the workspace is a vscode-remote:// URI and no file context reveals the real path, so every filesystem tool call failed. Inject the resolved workspace root into the agent/plan system message so models can point tools at the real path. Fixes continuedev#13082
Contributor
|
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
Author
|
I have read the CLA Document and I hereby sign the CLA |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #13082 — Continue Agent filesystem tools resolve
C:\workspaceinstead of the actual workspace, breaking all filesystem tools on Remote-SSH (and Dev Containers / anyvscode-remote://setup).Root cause: the agent/plan system message instructs models to use filesystem tools with paths "relative to the root of the workspace" — but never tells the model what that root is. On local workspaces the model can infer it from
file://context URIs, but on Remote-SSH the workspace is avscode-remote://ssh-remote+host/optURI, so no context ever reveals the real path. The model then guesses (C:\workspace), and everyreadFile/ls/viewSubdirectorycall fails with "The directory c:\workspace does not exist."Fix: when the session has filesystem tools available, inject a
<workspace_info>block into the agent/plan system message stating the resolved workspace root:The root is derived from
window.workspacePaths[0](the same source the session metadata already uses) via a newgetWorkspaceDisplayPath()helper that handles:file:///C:/Users/...→C:/Users/...(Windows local)file:///home/user/proj→/home/user/proj(POSIX local)vscode-remote://ssh-remote+host/opt→/opt(Remote-SSH / Dev Containers)vscode-vfs://...→ remote pathuntitled:/empty → skipped (no injection)Chat mode is untouched; the injection only happens in agent/plan modes when tools are actually enabled, so it never contradicts the no-tools warning.
Checklist
getWorkspaceDisplayPathunit tests + system-message injection tests)Testing
vitest run src/redux/util/— 46/46 tests pass (3 new test cases covering the helper and the injection)tsc --noEmit— clean on all changed files (pre-existing workspace-package errors incore/are unrelated)