Skip to content

Conversation

@DonJayamanne
Copy link
Collaborator

@DonJayamanne DonJayamanne self-assigned this Jan 28, 2026
@DonJayamanne DonJayamanne marked this pull request as ready for review January 28, 2026 04:04
Copilot AI review requested due to automatic review settings January 28, 2026 04:04
@vs-code-engineering vs-code-engineering bot added this to the January 2026 milestone Jan 28, 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 aims to fix issue #290947 by preventing multiple trust dialogs from appearing for background sessions in empty workspaces. The changes introduce a caching mechanism to remember trust decisions for repositories in empty workspaces, avoiding repeated prompts to the user.

Changes:

  • Introduced a new caching mechanism (_repositoryCacheInEmptyWorkspace) to store trust decisions for repositories in empty workspaces
  • Added getCachedRepository() method to manage repository retrieval with cached trust decisions
  • Renamed checkFileExists() to checkPathExists() to better reflect its usage for both files and directories
  • Refactored trust verification logic to use the new cached repository method instead of manual .git folder checks
  • Updated moveOrCopyChangesToWorkTree() to accept an explicit repository path parameter instead of relying on the active repository
  • Removed IFileSystemService parameter from CopilotCLIChatSessionParticipant constructor (no longer needed)

Reviewed changes

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

File Description
src/extension/chatSessions/vscode-node/copilotCLIChatSessionsContribution.ts Main implementation: added repository caching for empty workspaces, refactored trust dialog logic, renamed utility function, and improved repository retrieval in worktree operations
src/extension/chatSessions/vscode-node/test/copilotCLIChatSessionParticipant.spec.ts Updated test to remove the now-unused MockFileSystemService parameter from participant constructor
Comments suppressed due to low confidence (1)

src/extension/chatSessions/vscode-node/copilotCLIChatSessionsContribution.ts:802

  • Grammar issue: "lets" should be "let's" (contraction of "let us").
		// If we have repo then its trusted, lets get the latest information again by requesting the repo again.

@DonJayamanne DonJayamanne added this pull request to the merge queue Jan 28, 2026
Merged via the queue into main with commit c31cab8 Jan 28, 2026
19 checks passed
@DonJayamanne DonJayamanne deleted the don/single-trust-dialog branch January 28, 2026 05:59
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.

Prompted to trust folder/.git twice when selecting a untrusted folder in the background picker

3 participants