Skip to content

Update permission request handling to include working directory parameter#4026

Merged
DonJayamanne merged 5 commits intomainfrom
don/hostile-narwhal
Feb 26, 2026
Merged

Update permission request handling to include working directory parameter#4026
DonJayamanne merged 5 commits intomainfrom
don/hostile-narwhal

Conversation

@DonJayamanne
Copy link
Collaborator

Copilot AI review requested due to automatic review settings February 26, 2026 04:10
@DonJayamanne DonJayamanne self-assigned this Feb 26, 2026
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Feb 26, 2026
osortega
osortega previously approved these changes Feb 26, 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 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 workingDirectory parameter to the permission request flow (requestPermission and getConfirmationToolParams)
  • Updated logic to prefer workingDirectory over 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>
DonJayamanne and others added 3 commits February 26, 2026 15:22
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@DonJayamanne DonJayamanne added this pull request to the merge queue Feb 26, 2026
Merged via the queue into main with commit ea9e391 Feb 26, 2026
19 checks passed
@DonJayamanne DonJayamanne deleted the don/hostile-narwhal branch February 26, 2026 05:14
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.

Incorrect prompt to author edit to sensitive file in bg sessions

4 participants