Skip to content

"Open in VS Code" opens the workspace file's parent folder instead of the .code-workspace #112

Closed

Description

For a multi-repo project defined by a .code-workspace file, the Open-in picker launches the editor on the containing directory, so VS Code opens it as a plain folder rather than as a multi-root workspace. The repo roots don't appear in the editor's tree.

Cause looks like ChatView.tsx:5904 passing openInCwd={gitCwd}, where gitCwd resolves from activeProject.workspaceRoot (ChatView.tsx:2446-2451) — which for a workspace-file project is the anchor directory by design (WorkspaceManifest.ts module docs).

The project already carries workspaceFile (contracts/orchestration.ts:216, migration 038_ProjectionProjectsWorkspaceFile), so passing that when present should fix it. Passing a file path is already supported — FilePreviewPanel.tsx:910 passes openInCwd={absolutePath} for a single file.

One caveat: this probably wants to be editor-aware rather than an unconditional swap. vscode / vscode-insiders / cursor understand .code-workspace files, but zed (contracts/editor.ts) would just open it as JSON text, which would be worse than the current behaviour.

Version: multi-repo-workspaces @ 92de5d9a, macOS arm64, dev build (pnpm dev).

Thanks for maintaining this fork — the multi-repo support is exactly what I needed.

Activity

  1. LoganRupe commented on Aug 10, 2026

    @LoganRupe
    Owner

    Fixed in b79f415 on multi-repo-workspaces, and confirmed working on a real multi-repo project.

    The .code-workspace path is now passed alongside the anchor directory and chosen between per editor, resolved server-side in externalLauncher since the right target depends on which editor you pick. Your caveat was correct, so the editor registry gained an explicit supportsWorkspaceFile flag: the VS Code family gets the workspace file, while Zed, JetBrains and the file manager keep getting the directory.

    One known limit: isolated runs still open the worktree rather than a multi-root workspace. The fanned-out worktrees have no .code-workspace of their own, and the project's would open the original checkouts instead — tracked in #125.

    Note the branch is rebased onto upstream main periodically and force-pushed, so reset rather than pull. The pre-rebase tip is at multi-repo-workspaces-prerebase.

    Closing — thanks for the precise report, the file:line pointers made this straightforward.

  2. stefanvandervelden-zipline commented on Oct 11, 2026

    @stefanvandervelden-zipline
    Author

    Reopening: this isn't in the orchestrator v2 re-implementation (#338), which is now multi-repo-workspaces @ 2ba7964848. The fix (ced2fc04e1 on multi-repo-workspaces-pre-v2) wasn't ported.

    On v2, projects no longer store a workspaceFile. Repos are found at runtime from the folder's .code-workspace (WorkspaceRepositories). But "Open in" still passes only the folder: ThreadDetailsPanel passes openInCwd={props.gitCwd}, and externalLauncher launches the editor on input.cwd with no .code-workspace handling. So VS Code opens the containing folder as a plain folder again.

    To re-implement on v2: when the project folder has a .code-workspace and the editor is in the VS Code family (vscode, vscode-insiders, cursor, …), open the file instead of the folder. Other editors (Zed, JetBrains, file manager) keep getting the folder. That's the same split as the original fix.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions