chatSessions: optimize workspace changes handling for shared repositories#308649
Merged
DonJayamanne merged 3 commits intomainfrom Apr 9, 2026
Merged
chatSessions: optimize workspace changes handling for shared repositories#308649DonJayamanne merged 3 commits intomainfrom
DonJayamanne merged 3 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses performance issues when loading Copilot CLI Sessions in workspaces with many folders by deduplicating/serializing workspace-change computations across sessions that share the same underlying repository + branch context.
Changes:
- Introduces a repo-scoped cache key (repo path + base branch + branch) so multiple sessions can reuse the same computed workspace changes result.
- Adds a repo-level sequencer to ensure only one git computation runs per shared repo key at a time.
- Extends unit tests to cover shared-repo caching behavior and cache invalidation on tracked-folder deletion.
Show a summary per file
| File | Description |
|---|---|
| extensions/copilot/src/extension/chatSessions/vscode-node/chatSessionWorkspaceFolderServiceImpl.ts | Adds repo-keyed caching + repo-level sequencing for workspace changes, plus session→repoKey tracking and invalidation. |
| extensions/copilot/src/extension/chatSessions/vscode-node/test/chatSessionWorkspaceFolderService.spec.ts | Adds tests validating shared-repo cache reuse, branch isolation, and invalidation behavior. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 1
Contributor
There was a problem hiding this comment.
Pull request overview
Optimizes Copilot CLI chat session “workspace changes” computation by introducing repo-scoped caching/serialization so multiple sessions that reference the same repository/branch/base branch can reuse work and avoid duplicate git operations (addressing #308645).
Changes:
- Add repo-keyed cache + repo-level sequencer to share/serialize
getWorkspaceChangesacross sessions with identical repo+baseBranch+branch. - Add a negative cache for sessions without repository properties to avoid repeated metadata reads.
- Extend unit tests to cover cache invalidation, negative caching, and shared-repo serialization behavior.
Show a summary per file
| File | Description |
|---|---|
| extensions/copilot/src/extension/chatSessions/vscode-node/chatSessionWorkspaceFolderServiceImpl.ts | Introduces repo-keyed caching/serialization and negative caching for workspace changes. |
| extensions/copilot/src/extension/chatSessions/vscode-node/test/chatSessionWorkspaceFolderService.spec.ts | Adds tests validating repo-level caching behavior, negative caching, and invalidation scenarios. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 3
bryanchen-d
approved these changes
Apr 9, 2026
joshspicer
pushed a commit
that referenced
this pull request
Apr 9, 2026
…ries (#308649) * chatSessions: optimize workspace changes handling for shared repositories * Updates * updates
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.
Fixes #308645