Skip to content

Auto approve reading files from original repo when using worktrees#4280

Merged
DonJayamanne merged 4 commits intomainfrom
don/strict-ostrich
Mar 8, 2026
Merged

Auto approve reading files from original repo when using worktrees#4280
DonJayamanne merged 4 commits intomainfrom
don/strict-ostrich

Conversation

@DonJayamanne
Copy link
Collaborator

No description provided.

@DonJayamanne DonJayamanne self-assigned this Mar 8, 2026
@DonJayamanne DonJayamanne marked this pull request as ready for review March 8, 2026 04:09
Copilot AI review requested due to automatic review settings March 8, 2026 04:09
@DonJayamanne DonJayamanne enabled auto-merge March 8, 2026 04:09
@vs-code-engineering vs-code-engineering bot added this to the 1.112.0 milestone Mar 8, 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 auto-approve read permission requests for files that belong to the “session workspace” when a Copilot CLI session is using a git worktree as its working directory—so reads from the original repository don’t unnecessarily prompt the user.

Changes:

  • Updated Copilot CLI session logic to use this.workspace consistently when deriving working directory.
  • Added a helper to decide whether a requested read path is within the session workspace (working directory / folder / repo-worktree context).
  • Added unit tests covering read auto-approval behavior for worktree-related workspace shapes.

Reviewed changes

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

File Description
src/extension/chatSessions/copilotcli/node/copilotcliSession.ts Refactors working directory lookups and introduces session-workspace read auto-approval helper.
src/extension/chatSessions/copilotcli/node/test/copilotcliSession.spec.ts Adds tests validating read auto-approval when worktrees are present.

DonJayamanne and others added 3 commits March 8, 2026 15:17
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 Mar 8, 2026
Merged via the queue into main with commit d536131 Mar 8, 2026
19 checks passed
@DonJayamanne DonJayamanne deleted the don/strict-ostrich branch March 8, 2026 06:24
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