Skip to content

Refactor chat session worktree handling and remove unused components#312109

Merged
DonJayamanne merged 9 commits intomainfrom
don/interested-butterfly
Apr 23, 2026
Merged

Refactor chat session worktree handling and remove unused components#312109
DonJayamanne merged 9 commits intomainfrom
don/interested-butterfly

Conversation

@DonJayamanne
Copy link
Copy Markdown
Contributor

Co-authored-by: Copilot copilot@github.com

Copilot AI review requested due to automatic review settings April 23, 2026 09:59
@DonJayamanne DonJayamanne self-assigned this Apr 23, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: e2accb2b Current: eb28995f

Changed (1)

chat/aiCustomizations/aiCustomizationManagementEditor/McpBrowseMode/Dark
Before After
before after

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 WorktreeSessionIndex and the associated metadata-store behaviors/tests.
  • Simplified getWorktreeProperties APIs to be session-id-only (removed folder-based overloads / sessionId-for-worktree lookup).
  • Added ISessionWorkingDirectoryStore and 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

DonJayamanne and others added 7 commits April 23, 2026 20:14
Co-authored-by: Copilot <copilot@github.com>
…adata store

Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
@DonJayamanne DonJayamanne marked this pull request as ready for review April 23, 2026 12:01
@DonJayamanne DonJayamanne enabled auto-merge (squash) April 23, 2026 12:02
@DonJayamanne DonJayamanne merged commit 677ee01 into main Apr 23, 2026
26 checks passed
@DonJayamanne DonJayamanne deleted the don/interested-butterfly branch April 23, 2026 14:31
@vs-code-engineering vs-code-engineering Bot added this to the 1.118.0 milestone Apr 23, 2026
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.

3 participants