Skip to content

Background - cache folder changes for the various error conditions#308289

Merged
lszomoru merged 1 commit intomainfrom
vscode-copilot-chat/migrate-5029
Apr 7, 2026
Merged

Background - cache folder changes for the various error conditions#308289
lszomoru merged 1 commit intomainfrom
vscode-copilot-chat/migrate-5029

Conversation

@lszomoru
Copy link
Copy Markdown
Member

@lszomoru lszomoru commented Apr 7, 2026

Migrated from microsoft/vscode-copilot-chat#5029
Original author: @lszomoru

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

Screenshot Changes

Base: fc99d59e Current: 8575fc76

Changed (4)

chat/aiCustomizations/aiCustomizationManagementEditor/PromptsTab/Dark
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/HooksTab/Light
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/PromptsTabScrolled/Light
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/McpServersTabNarrow/Light
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

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 changes data) 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.getRepository is only called once across two getWorkspaceChanges calls 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

@lszomoru lszomoru merged commit 7446c69 into main Apr 7, 2026
27 checks passed
@lszomoru lszomoru deleted the vscode-copilot-chat/migrate-5029 branch April 7, 2026 18:51
@vs-code-engineering vs-code-engineering bot added this to the 1.116.0 milestone Apr 7, 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