Update permission request handling to include working directory parameter#4026
Merged
DonJayamanne merged 5 commits intomainfrom Feb 26, 2026
Merged
Update permission request handling to include working directory parameter#4026DonJayamanne merged 5 commits intomainfrom
DonJayamanne merged 5 commits intomainfrom
Conversation
osortega
previously approved these changes
Feb 26, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the permission request handling for Copilot CLI sessions to include a workingDirectory parameter, addressing issue #297867. The working directory is used to determine whether file edits require user confirmation - files within the working directory are auto-approved without confirmation prompts.
Changes:
- Added
workingDirectoryparameter to the permission request flow (requestPermissionandgetConfirmationToolParams) - Updated logic to prefer
workingDirectoryover workspace folder when determining if a file edit should be auto-approved - Added comprehensive test coverage for the new behavior
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/extension/chatSessions/vscode-node/copilotCLIChatSessionsContribution.ts |
Pass workingDirectory to the requestPermission handler |
src/extension/agents/copilotcli/node/permissionHelpers.ts |
Add workingDirectory parameter and logic to determine workspace folder, preferring working directory when file is within it |
src/extension/agents/copilotcli/node/test/permissionHelpers.spec.ts |
Add three new test cases covering scenarios where working directory does/doesn't cover files |
Comments suppressed due to low confidence (1)
src/extension/agents/copilotcli/node/permissionHelpers.ts:143
- Typo in comment: "thats" should be "that's" or "that is".
// Get hold of file thats being edited if this is a edit tool call (requiring write permissions).
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ying edited files
joshspicer
approved these changes
Feb 26, 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.
Fixes microsoft/vscode#297867