Skip to content

Conversation

@lszomoru
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings January 30, 2026 23:12
@lszomoru lszomoru self-assigned this Jan 30, 2026
@lszomoru lszomoru enabled auto-merge January 30, 2026 23:12
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Jan 30, 2026
Copy link
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

This PR refactors the chat session worktree changes caching mechanism by moving from a separate in-memory Map (_sessionWorktreeChanges) to storing the changes as part of the persisted ChatSessionWorktreeProperties. This consolidates state management and ensures changes are persisted alongside other worktree metadata.

Changes:

  • Introduced ChatSessionWorktreeFile interface to represent file changes with a simpler, serializable structure
  • Modified ChatSessionWorktreeProperties to include an optional changes field for caching worktree file changes
  • Refactored getWorktreeChanges to store/retrieve cached changes from worktree properties instead of a separate Map
  • Updated conversion logic in copilotCLIChatSessionsContribution.ts to transform ChatSessionWorktreeFile to vscode.ChatSessionChangedFile2 with proper Git URIs

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/extension/chatSessions/common/chatSessionWorktreeService.ts Added ChatSessionWorktreeFile interface and changes field to ChatSessionWorktreeProperties
src/extension/chatSessions/vscode-node/chatSessionWorktreeServiceImpl.ts Removed _sessionWorktreeChanges Map, refactored caching to use worktree properties, updated cache invalidation logic
src/extension/chatSessions/vscode-node/copilotCLIChatSessionsContribution.ts Added conversion from ChatSessionWorktreeFile to vscode.ChatSessionChangedFile2 with Git URI mapping

Copy link
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@lszomoru lszomoru added this pull request to the merge queue Feb 2, 2026
Merged via the queue into main with commit cb63666 Feb 2, 2026
19 checks passed
@lszomoru lszomoru deleted the lszomoru/background-session-caching branch February 2, 2026 07:46
lszomoru added a commit that referenced this pull request Feb 2, 2026
* Initial implementation

* Second iteration

* Pull request feedback

* Fix opening the changes from the session

* Disable the Apply action in the empty window

* Hide Apply action in empty window
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