Skip to content

fix: discover .vscode-server workspaceStorage dirs for WSL / Remote SSH / devcontainer#63

Merged
san360 merged 3 commits into
microsoft:mainfrom
hora7ce:fix/vscode-server-log-discovery
Jun 2, 2026
Merged

fix: discover .vscode-server workspaceStorage dirs for WSL / Remote SSH / devcontainer#63
san360 merged 3 commits into
microsoft:mainfrom
hora7ce:fix/vscode-server-log-discovery

Conversation

@hora7ce
Copy link
Copy Markdown
Contributor

@hora7ce hora7ce commented May 26, 2026

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:

~/.vscode-server/data/User/workspaceStorage
~/.vscode-server-insiders/data/User/workspaceStorage

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-server and ~/.vscode-server-insiders on non-Windows platforms
  • harnessFromPath() — add .vscode-server-insiders and .vscode-server checks (most-specific first to prevent the Insiders path matching the plain .vscode-server substring), returning 'Local Agent (Server)' / 'Local Agent (Server Insiders)' instead of falling through to 'Local Agent'
  • Tests — three new cases covering both server editions and the substring-ordering invariant

Related Issues

Fixes #62

Checklist

  • npm run check passes (typecheck + lint + spellcheck + knip + tests)
  • Changes are covered by tests
  • Documentation updated (n/a — no user-visible doc change required)

…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
@hora7ce
Copy link
Copy Markdown
Contributor Author

hora7ce commented May 26, 2026

@microsoft-github-policy-service agree

Copy link
Copy Markdown
Contributor

@san360 san360 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. 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/ |

  2. 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.

  3. docs/content/_index.md — Add Local 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
@san360 san360 marked this pull request as draft May 31, 2026 12:24
@san360
Copy link
Copy Markdown
Contributor

san360 commented May 31, 2026

@hora7ce CI is currently failing on lint for this PR.

Root cause: @typescript-eslint/no-unused-vars in src/core/parser-vscode.test.ts because vi is imported but not used.

Please push a small fix commit to remove the unused vi import, then re-request review once checks are green.

@hora7ce hora7ce marked this pull request as ready for review June 1, 2026 12:58
@san360 san360 self-requested a review June 2, 2026 19:49
@san360 san360 merged commit 3087100 into microsoft:main Jun 2, 2026
5 checks passed
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.

bug: Dashboard shows "No Copilot chat log directories found" on WSL / VS Code Server / Remote SSH

2 participants