Background - cache folder changes for the various error conditions#308289
Merged
Background - cache folder changes for the various error conditions#308289
Conversation
Member
lszomoru
commented
Apr 7, 2026
Contributor
Screenshot ChangesBase: Changed (4) |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Copilot Chat Sessions workspace-folder change tracking to cache “no changes” results for additional error/edge conditions, reducing repeated work and repeated warnings during a request.
Changes:
- Cache an empty change list when repository properties are missing for a session.
- Cache an empty change list when the git repository (or its
changesdata) is unavailable.
Show a summary per file
| File | Description |
|---|---|
| extensions/copilot/src/extension/chatSessions/vscode-node/chatSessionWorkspaceFolderServiceImpl.ts | Adds caching for empty workspace changes in more early-return/error paths within getWorkspaceChanges. |
Copilot's findings
Comments suppressed due to low confidence (1)
extensions/copilot/src/extension/chatSessions/vscode-node/chatSessionWorkspaceFolderServiceImpl.ts:106
- New behavior caches an empty changes array when no repository (or no
repository.changes) is available. Please extend tests to verify subsequent calls hit the cache (e.g.,gitService.getRepositoryis only called once across twogetWorkspaceChangescalls for the same session) to ensure this error-path caching keeps working.
const repository = await this.gitService.getRepository(vscode.Uri.file(repositoryProperties.repositoryPath));
if (!repository?.changes) {
this.logService.warn(`[ChatSessionWorkspaceFolderService][getWorkspaceChanges] No repository found for session ${sessionId}`);
this.workspaceFolderChanges.set(sessionId, []);
return [];
- Files reviewed: 1/1 changed files
- Comments generated: 2
...ions/copilot/src/extension/chatSessions/vscode-node/chatSessionWorkspaceFolderServiceImpl.ts
Show resolved
Hide resolved
...ions/copilot/src/extension/chatSessions/vscode-node/chatSessionWorkspaceFolderServiceImpl.ts
Show resolved
Hide resolved
joshspicer
approved these changes
Apr 7, 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.