Skip to content

Implement rebaseUnder function and enhance customization anchoring in CopilotAgent#322661

Merged
DonJayamanne merged 3 commits into
mainfrom
don/entitled-caterpillar
Jun 24, 2026
Merged

Implement rebaseUnder function and enhance customization anchoring in CopilotAgent#322661
DonJayamanne merged 3 commits into
mainfrom
don/entitled-caterpillar

Conversation

@DonJayamanne

Copy link
Copy Markdown
Contributor

Fixes #322527

Copilot AI review requested due to automatic review settings June 24, 2026 02:21
@DonJayamanne DonJayamanne self-assigned this Jun 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Addresses issue #322527 where worktree-isolated Copilot sessions could still discover skills/instructions/agents from the original folder (leading the session to read/write files outside the worktree). The PR re-anchors customization discovery to the resolved working directory (worktree when materialized/resumed) and adds a small URI rebasing helper plus targeted tests.

Changes:

  • Add rebaseUnder() helper to rebase URIs from one directory to another while preserving relative paths.
  • Re-anchor customization discovery during session materialization/resume so skills/instructions are discovered from the worktree.
  • Add unit tests covering rebasing behavior and customization anchoring for worktree materialization.
Show a summary per file
File Description
src/vs/platform/agentHost/node/copilot/copilotAgent.ts Re-anchor customization discovery to the resolved working directory (worktree) and migrate enablement state across anchor changes.
src/vs/platform/agentHost/test/node/copilotAgent.test.ts Add tests for rebaseUnder and for anchoring customization discovery to the resolved worktree during materialization.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

Comment thread src/vs/platform/agentHost/node/copilot/copilotAgent.ts
@DonJayamanne DonJayamanne marked this pull request as ready for review June 24, 2026 02:52
@DonJayamanne DonJayamanne enabled auto-merge (squash) June 24, 2026 02:53
@DonJayamanne DonJayamanne merged commit 7b91f5f into main Jun 24, 2026
28 checks passed
@DonJayamanne DonJayamanne deleted the don/entitled-caterpillar branch June 24, 2026 04:16
@vs-code-engineering vs-code-engineering Bot added this to the 1.127.0 milestone Jun 24, 2026
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.

A worktree session is reading files in main folder not in worktree

3 participants