Repository navigation
fix(hoosage): read Copilot CLI sessions from WSL on Windows - #48
Merged
Merged
Conversation
Windows VS Code windows that open a WSL folder via \\wsl.localhost never saw Copilot CLI sessions run inside that distribution, because only the Windows ~/.copilot/session-state was read. Read session-state of running WSL distributions (never starting a stopped one), map Linux working directories to their Windows form for project matching, and skip shared-sync entries already read locally. Can be disabled with hoosage.readWslCliSessions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a WSL folder is opened in Windows VS Code (
\\wsl.localhost\<distro>\...), hoosage runs on Windows and only reads the Windows~/.copilot/session-state. Copilot CLI sessions started inside the WSL distribution (/home/<user>/.copilot/session-state) were never counted, so WSL projects showed far too little CLI usage.Fix
WslCliSessions(src/core/wsl-sessions.ts): on Windows, lists running distributions viawsl.exe --list --running --quietright before reading (normally every 15 s), so a stopped distribution is never started. Discovers/rootand/home/*.copilot/session-statevia\\wsl.localhost\<distro>and reusesCliUsageScannerper folder./home/u/repo→\\wsl.localhost\<distro>\home\u\repo,/mnt/c/repo→C:\repo. WSL CLI sessions therefore join the project of the WSL folder opened in Windows VS Code.hoosage.readWslCliSessions(defaulttrue). Diagnose Tracking reports the number of WSL session folders read.Verification
npm run checkpasses (75 tests, including 4 new ones intest/wsl-sessions.test.ts).VRKBdistribution resolve to the project of\\wsl.localhost\VRKB\home\<u>\src\vrkb. Previously none of them were visible.