Refactor chat session worktree handling and remove unused components#312109
Merged
DonJayamanne merged 9 commits intomainfrom Apr 23, 2026
Merged
Refactor chat session worktree handling and remove unused components#312109DonJayamanne merged 9 commits intomainfrom
DonJayamanne merged 9 commits intomainfrom
Conversation
Co-authored-by: Copilot <copilot@github.com>
Contributor
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors Copilot CLI chat session worktree/session-folder association by removing the persisted JSONL worktree index and related APIs, and replacing the “folder ↔ session” lookup with an in-memory working-directory store used by session providers and repository tracking.
Changes:
- Removed JSONL-backed
WorktreeSessionIndexand the associated metadata-store behaviors/tests. - Simplified
getWorktreePropertiesAPIs to be session-id-only (removed folder-based overloads / sessionId-for-worktree lookup). - Added
ISessionWorkingDirectoryStoreand wired it into session item/content providers and worktree commit/cache invalidation paths.
Show a summary per file
| File | Description |
|---|---|
| extensions/copilot/src/extension/chatSessions/vscode-node/worktreeSessionIndex.ts | Deletes JSONL-backed worktree/session index implementation. |
| extensions/copilot/src/extension/chatSessions/vscode-node/test/chatSessionMetadataStoreImpl.spec.ts | Removes tests covering JSONL index + folder-based worktree lookup/scan behavior. |
| extensions/copilot/src/extension/chatSessions/vscode-node/copilotCLIChatSessionsContribution.ts | Uses working-directory store for associating worktrees with sessions; adjusts cached-changes gating. |
| extensions/copilot/src/extension/chatSessions/vscode-node/copilotCLIChatSessions.ts | Same association + cache invalidation changes for the controller-based provider. |
| extensions/copilot/src/extension/chatSessions/vscode-node/chatSessions.ts | Registers the new working-directory store service in relevant child instantiation services. |
| extensions/copilot/src/extension/chatSessions/vscode-node/chatSessionWorktreeServiceImpl.ts | Removes folder-based worktree property lookup and sessionId-for-worktree helper. |
| extensions/copilot/src/extension/chatSessions/vscode-node/chatSessionRepositoryTracker.ts | Uses working-directory store to find sessions affected by repo state changes. |
| extensions/copilot/src/extension/chatSessions/vscode-node/chatSessionMetadataStoreImpl.ts | Removes JSONL maintenance/top-up and session-state scan logic. |
| extensions/copilot/src/extension/chatSessions/copilotcli/node/cliHelpers.ts | Removes getCopilotWorktreeSessionsFile helper. |
| extensions/copilot/src/extension/chatSessions/common/test/mockChatSessionMetadataStore.ts | Updates mock metadata store API to session-id-only worktree lookup. |
| extensions/copilot/src/extension/chatSessions/common/sessionWorkingDirectoryStore.ts | Introduces in-memory session-id ↔ folder association store service. |
| extensions/copilot/src/extension/chatSessions/common/chatSessionWorktreeService.ts | Updates worktree service interface (removes folder overload + sessionId-for-worktree). |
| extensions/copilot/src/extension/chatSessions/common/chatSessionMetadataStore.ts | Updates metadata store interface (removes folder-based worktree lookup + sessionId-for-worktree). |
Copilot's findings
- Files reviewed: 13/13 changed files
- Comments generated: 5
…adata store Co-authored-by: Copilot <copilot@github.com>
lramos15
approved these changes
Apr 23, 2026
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.
Co-authored-by: Copilot copilot@github.com