-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Display a single trust dialog for bg sessions #3221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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()tocheckPathExists()to better reflect its usage for both files and directories - Refactored trust verification logic to use the new cached repository method instead of manual
.gitfolder checks - Updated
moveOrCopyChangesToWorkTree()to accept an explicit repository path parameter instead of relying on the active repository - Removed
IFileSystemServiceparameter fromCopilotCLIChatSessionParticipantconstructor (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.
src/extension/chatSessions/vscode-node/copilotCLIChatSessionsContribution.ts
Outdated
Show resolved
Hide resolved
src/extension/chatSessions/vscode-node/copilotCLIChatSessionsContribution.ts
Show resolved
Hide resolved
src/extension/chatSessions/vscode-node/copilotCLIChatSessionsContribution.ts
Outdated
Show resolved
Hide resolved
src/extension/chatSessions/vscode-node/copilotCLIChatSessionsContribution.ts
Outdated
Show resolved
Hide resolved
src/extension/chatSessions/vscode-node/copilotCLIChatSessionsContribution.ts
Outdated
Show resolved
Hide resolved
src/extension/chatSessions/vscode-node/copilotCLIChatSessionsContribution.ts
Outdated
Show resolved
Hide resolved
…ontribution.ts Co-authored-by: Copilot <[email protected]>
…ontribution.ts Co-authored-by: Copilot <[email protected]>
…ontribution.ts Co-authored-by: Copilot <[email protected]>
…ontribution.ts Co-authored-by: Copilot <[email protected]>
Fixes microsoft/vscode#290947