Skip to content

Fix VS Code Remote-WSL project root detection (issue #1032) - #1033

Open
daniel-vincent-veriforce wants to merge 2 commits into
mksglu:nextfrom
daniel-vincent-veriforce:fix/vscode-remote-wsl-project-root
Open

Fix VS Code Remote-WSL project root detection (issue #1032)#1033
daniel-vincent-veriforce wants to merge 2 commits into
mksglu:nextfrom
daniel-vincent-veriforce:fix/vscode-remote-wsl-project-root

Conversation

@daniel-vincent-veriforce

@daniel-vincent-veriforce daniel-vincent-veriforce commented Aug 4, 2026

Copy link
Copy Markdown

What / Why / How

Fixes #1032.

When VS Code is launched from a shortcut on Windows and opens a remote WSL workspace, VSCODE_CWD can point to the local VS Code installation directory rather than the remote workspace. The VS Code Copilot adapter previously trusted that value and anchored project-boundary checks to the install directory, rejecting legitimate remote file reads.

This change:

  • Adds isVSCodeInstallPath() with cross-platform separator support for stable/Insiders Windows, macOS, and Linux install locations.
  • Keeps CLAUDE_PROJECT_DIR as the highest-priority value.
  • Skips an install-directory VSCODE_CWD and falls through to process.cwd().
  • Adds unit coverage for install-path detection and the adapter cascade.
  • Hardens the existing standalone fatal-exit test timeout for slow WSL startup.

All paths and user names in the issue and tests are anonymized.

Affected platforms

  • Claude Code
  • Cursor
  • VS Code Copilot (GitHub Copilot)
  • JetBrains Copilot
  • Gemini CLI
  • Qwen Code
  • OpenCode
  • KiloCode
  • Codex CLI
  • OpenClaw (Pi Agent)
  • Pi
  • Kiro
  • Antigravity
  • Zed
  • All platforms

Test plan

  • Focused Vitest: utility, VS Code adapter, and lifecycle tests — 67 passed.
  • npm run typecheck — passed.
  • Build, bundle assertions, and asymmetric-drift assertions — passed.
  • Full npm test4,703 passed, 44 skipped.

The lifecycle test-only timeout change addresses slow standalone bundle startup under WSL; no production lifecycle behavior was changed.

Checklist

  • Tests added/updated (TDD: red → green)
  • npm test passes
  • npm run typecheck passes
  • Docs updated if needed
  • No Windows path regressions (forward slashes only)
  • Targets next branch

@daniel-vincent-veriforce
daniel-vincent-veriforce force-pushed the fix/vscode-remote-wsl-project-root branch from c868008 to cb8b8e5 Compare August 4, 2026 12:23
@daniel-vincent-veriforce daniel-vincent-veriforce changed the title Fix VS Code Remote-WSL project root detection Fix VS Code Remote-WSL project root detection (issue #1032) Aug 4, 2026
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.

1 participant