fix: handle case-sensitive extension ID and nested chatSessions path#653
Merged
fix: handle case-sensitive extension ID and nested chatSessions path#653
Conversation
Newer versions of Copilot Chat (tested with v0.45.0) store workspace sessions under workspaceStorage/<hash>/GitHub.copilot-chat/chatSessions/ rather than directly at workspaceStorage/<hash>/chatSessions/. On Linux the filesystem is case-sensitive, so 'GitHub.copilot-chat' and 'github.copilot-chat' are different paths. Our code hardcoded the lowercase variant which silently found nothing. Changes: - workspaceStorage scan now checks three candidate chatSessions paths per workspace hash: the legacy flat path plus both casing variants of the GitHub.copilot-chat extension subfolder - globalStorage copilot-chat scan now iterates over both 'GitHub.copilot-chat' (mixed case, as VS Code creates it on Linux) and 'github.copilot-chat' (lowercase, kept for Windows/macOS compatibility) Fixes the root cause reported in #647 where a user running VS Code natively inside WSL saw 0 session files despite having active Copilot Chat sessions. 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
Two related bugs cause 0 session files to be found for users running VS Code natively inside WSL (reported in #647):
Bug 1 — Case-sensitive extension ID in globalStorage
VS Code creates the extension storage folder using the extension's publisher+name ID as-is. On a case-sensitive Linux filesystem
GitHub.copilot-chatandgithub.copilot-chatare different paths. The extension hardcoded the all-lowercase variantgithub.copilot-chat, which silently found nothing when the real folder wasGitHub.copilot-chat.Bug 2 — Nested
chatSessionspath in newer Copilot ChatOlder versions of Copilot Chat stored sessions at:
Newer versions (v0.45.0, as reported by the user in #647) nest their storage under the extension subfolder:
The extension only checked the flat path, so all sessions from newer Copilot Chat versions were invisible.
Changes
sessionDiscovery.tsworkspaceStoragescan: for each workspace hash, now checks three candidatechatSessionslocations:<hash>/chatSessions/— legacy flat path (still used by some installs)<hash>/GitHub.copilot-chat/chatSessions/— mixed-case extension subfolder (Linux)<hash>/github.copilot-chat/chatSessions/— lowercase (Windows/macOS fallback)globalStoragescan: iterates over bothGitHub.copilot-chatandgithub.copilot-chatso the correct folder is found regardless of filesystem case-sensitivity.Testing
935/935 unit tests pass. Compile and lint clean.
Closes #647