Skip to content

fix: tell models the workspace root so filesystem tools work on remote setups - #13096

Open
bunnysayzz wants to merge 1 commit into
continuedev:mainfrom
bunnysayzz:fix/workspace-root-in-system-message-13082
Open

fix: tell models the workspace root so filesystem tools work on remote setups#13096
bunnysayzz wants to merge 1 commit into
continuedev:mainfrom
bunnysayzz:fix/workspace-root-in-system-message-13082

Conversation

@bunnysayzz

Copy link
Copy Markdown

Description

Fixes #13082 — Continue Agent filesystem tools resolve C:\workspace instead of the actual workspace, breaking all filesystem tools on Remote-SSH (and Dev Containers / any vscode-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 a vscode-remote://ssh-remote+host/opt URI, so no context ever reveals the real path. The model then guesses (C:\workspace), and every readFile/ls/viewSubdirectory call 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:

<workspace_info>
Your workspace root is: /opt/billing
When using filesystem tools, pass paths relative to this root (e.g. "src/main.ts" for /opt/billing/src/main.ts) or absolute paths. Explore the workspace with the viewSubdirectory or ls tools instead of guessing paths.
</workspace_info>

The root is derived from window.workspacePaths[0] (the same source the session metadata already uses) via a new getWorkspaceDisplayPath() 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 path
  • untitled:/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

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 in core/ are unrelated)
  • Manually verified the helper output for Remote-SSH, Dev Containers, vscode-vfs, local POSIX, local Windows, and unsupported schemes

…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
@bunnysayzz
bunnysayzz requested a review from a team as a code owner August 6, 2026 06:49
@bunnysayzz
bunnysayzz requested review from sestinj and removed request for a team August 6, 2026 06:49
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


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.

@bunnysayzz

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Continue Agent filesystem tools resolve C:\workspace instead of Remote-SSH workspace

1 participant