fix: discover .vscode-server workspaceStorage dirs for WSL / Remote SSH / devcontainer#63
fix: discover .vscode-server workspaceStorage dirs for WSL / Remote SSH / devcontainer#63hora7ce wants to merge 2 commits into
Conversation
…SH / devcontainer findVsCodeDirs() only scanned desktop installation paths (~/.config/Code, AppData, ~/Library/...) and missed the VS Code Server path used by WSL2, Remote SSH, and Dev Containers: ~/.vscode-server/data/User/workspaceStorage ~/.vscode-server-insiders/data/User/workspaceStorage Add both server editions to the scan on non-Windows platforms. Also extend harnessFromPath() with .vscode-server-insiders and .vscode-server checks (ordered most-specific first to avoid the Insiders path matching the plain .vscode-server substring) so sessions discovered via these paths are labelled 'Local Agent (Server)' or 'Local Agent (Server Insiders)' rather than the fallback 'Local Agent'. Fixes microsoft#62
|
@microsoft-github-policy-service agree |
san360
left a comment
There was a problem hiding this comment.
Nice fix — the logic is correct, tests are well-structured, and there are no security concerns. A few items to address before merging:
Required: Documentation Updates
This PR introduces two new harness names (Local Agent (Server) and Local Agent (Server Insiders)) that will appear in the dashboard UI, but the docs don't mention them. Please update:
-
README.extension.md— Add two rows to the "Supported Harnesses" table:
| Local Agent (Server) |~/.vscode-server/data/User/workspaceStorage/|
| Local Agent (Server Insiders) |~/.vscode-server-insiders/data/User/workspaceStorage/| -
docs/content/getting-started/supported-tools.md— Under the "Local Agent (VS Code and VS Code Insiders)" section, add a note that when VS Code connects via Remote-WSL, Remote-SSH, or Dev Containers, logs are stored at~/.vscode-server/data/User/workspaceStorage/and shown as "Local Agent (Server)" in the dashboard. -
docs/content/_index.md— AddLocal Agent (Server)/Local Agent (Server Insiders)to the multi-harness table.
Nit: Add ordering comment in harnessFromPath() (non-blocking)
The substring collision between .vscode-server and .vscode-server-insiders relies on check ordering. A short comment would prevent a future contributor from accidentally reordering:
// Check .vscode-server-insiders BEFORE .vscode-server — the latter is a
// substring of the former and would match incorrectly if checked first.
if (logsDir.includes('.vscode-server-insiders')) return 'Local Agent (Server Insiders)';
if (logsDir.includes('.vscode-server')) return 'Local Agent (Server)';Nit: Explain the platform guard (non-blocking)
// VS Code Server only runs on the remote host (Linux/macOS), not on Windows directly
if (process.platform !== 'win32' && home) {Nice-to-have: findVsCodeDirs() test coverage
The new tests cover harnessFromPath() (string matching) but not findVsCodeDirs() itself. A test that mocks fs.existsSync to verify the server paths are included (and excluded on Windows) would strengthen confidence.
Overall this is a solid, well-scoped fix. The code and security posture look good — just needs the doc updates to be complete. 👍
- README.extension.md: add Local Agent (Server) and Local Agent (Server Insiders) rows to Supported Harnesses table - docs/content/_index.md: add server harness row to Multi-Harness Support table - docs/content/getting-started/supported-tools.md: note Remote-WSL/SSH/devcontainer log paths under Local Agent section - parser-vscode.ts: tighten harnessFromPath ordering comment (substring collision) and findVsCodeDirs platform guard comment per reviewer suggestions - parser-vscode.test.ts: add findVsCodeDirs test covering server workspaceStorage path inclusion via temporary home directory
Description
Fixes the dashboard showing "No Copilot chat log directories found" when the extension is used via VS Code Server (WSL2, Remote SSH, Dev Containers).
When VS Code connects to a remote host, it runs as a server and stores all workspaceStorage under:
findVsCodeDirs()only scanned the desktop installation paths (~/.config/Code, AppData,~/Library/...) and never checked these server paths, so the extension found no sessions.Changes
findVsCodeDirs()— scan~/.vscode-serverand~/.vscode-server-insiderson non-Windows platformsharnessFromPath()— add.vscode-server-insidersand.vscode-serverchecks (most-specific first to prevent the Insiders path matching the plain.vscode-serversubstring), returning'Local Agent (Server)'/'Local Agent (Server Insiders)'instead of falling through to'Local Agent'Related Issues
Fixes #62
Checklist
npm run checkpasses (typecheck + lint + spellcheck + knip + tests)