Repository navigation
Open in editor on a remote environment ignores workspaceFile and opens the containing folder #234
Description
Symptom
With a project whose workspaceFile is set (a .code-workspace listing several repo roots), Open in VS Code opens the directory containing the workspace file rather than the workspace itself, so the editor shows a single folder instead of the multi-root workspace.
This only happens when the environment is remote — i.e. when the client is not on the environment's machine and open-in has to emit a vscode://vscode-remote/ssh-remote+… deep link. The same project opened from a local environment opens correctly as a workspace.
Reproduced on multi-repo-workspaces @ 5b02511cd, macOS desktop client, remote environment added through the SSH launch flow (Settings → Connections → Remote Environments), project pointed at a .code-workspace on the remote host.
Root cause
OpenInPicker has two branches and only the local one passes workspaceFile — apps/web/src/components/chat/OpenInPicker.tsx:214-241:
if (remote.mode === "remote-links") {
const url = buildRemoteOpenUrl({
editor,
host: remote.host.host,
absolutePath: openInCwd, // <-- cwd only; openInWorkspaceFile never consulted
});
if (url === undefined) return;
void openRemoteEditorUrl(url).then(...);
return;
}
const result = openInEditorMutation({
environmentId,
input: {
cwd: openInCwd,
editor,
...(openInWorkspaceFile ? { workspaceFile: openInWorkspaceFile } : {}), // <-- local path uses it
},openInWorkspaceFile is plumbed correctly all the way to this component (ChatView.tsx:2915 → ChatHeader.tsx:434 → OpenInPicker.tsx:181), so the value is available at the point the remote branch runs — it is simply not read.
Why it is not a one-line fix
buildRemoteOpenUrl builds a folder URI (packages/contracts/src/editor.ts:139-153):
return `${scheme}://vscode-remote/ssh-remote+${encodeURIComponent(input.host)}${encodedPath}`;vscode://vscode-remote/ssh-remote+<host><path> asks VS Code to open <path> as a folder. Opening a .code-workspace over Remote-SSH needs a different URI form, so the builder needs to distinguish "open this folder" from "open this workspace file" rather than the call site just passing a different path. I have not verified which URI form VS Code accepts for a remote workspace file, so I have deliberately not proposed a patch.
Relationship to other issues
#185 fixed workspaceFile reaching the client, and that fix is working — the local branch above consumes it. This is the remote branch, which was never wired up, so it is a separate gap rather than a regression.
It is also adjacent to #125 (isolated runs don't open as a multi-root workspace): both end with the editor showing a folder where a multi-root workspace was intended, though the causes differ.
Verified vs not
- Verified: the code paths above, the plumbing of
openInWorkspaceFile, and the reproduction on a remote SSH-launched environment. - Not verified: the correct
vscode-remoteURI form for opening a workspace file, and whether Cursor and the other remote-capable editors accept the same form.
Reported from Claude Opus 4.6 running in Claude Code.
Activity
fix(web,contracts): remote open-in-editor honors the workspace file
LoganRupe commentedon Sep 8, 2026
Fixed on
multi-repo-workspacesin a905a0c (#235). Thanks for the writeup, the trace throughOpenInPickerwas exactly right and saved me the hunt.On the part you flagged as unverified: a remote workspace file needs no separate URI form. VS Code's protocol handler (
getWindowOpenableFromProtocolUrlinsrc/vs/code/electron-main/app.ts) branches on the file extension rather than the URI shape, returning aworkspaceUriinstead of afolderUriwhenever the path ends in.code-workspace. Sovscode://vscode-remote/ssh-remote+<host>/path/to/thing.code-workspacealready opens as a multi-root workspace.buildRemoteOpenUrlnow runs the sameresolveEditorTargetthe server uses and links the workspace file for editors that support one, and theremote-linksbranch ofOpenInPickerpassesopenInWorkspaceFilethrough. That also answers your Cursor question: every remote-capable editor we ship (Cursor, VSCodium, Insiders) is a VS Code fork inheriting this code, so they all get it.Confirmed working against a real remote SSH environment. Closing.
fix(web,contracts): remote open-in-editor honors the workspace file
fix(web,contracts): remote open-in-editor honors the workspace file
fix(web,contracts): remote open-in-editor honors the workspace file
fix(web,contracts): remote open-in-editor honors the workspace file
fix(web,contracts): remote open-in-editor honors the workspace file
stefanvandervelden-zipline commentedon Oct 11, 2026
Reopening: not in the orchestrator v2 re-implementation (#338, now
multi-repo-workspaces@2ba7964848). The fix (ef412bc798onmulti-repo-workspaces-pre-v2) wasn't ported.On v2,
OpenInPicker's remote-links branch callsbuildRemoteOpenUrl({ absolutePath: openInCwd })with the folder only, so remote environments open the containing folder again. This depends on #112 being re-implemented first. Once the client knows the workspace file, the remote branch should use it too. As noted when this was fixed, VS Code's protocol handler already opens a.code-workspacepath as a workspace, so no new link format is needed.