Skip to content

agentHost: canonicalize missing paths through all ancestors - #332668

Merged
Connor Peet (connor4312) merged 1 commit into
mainfrom
connor4312/agent-host-canonicalize-ancestors
Aug 26, 2026
Merged

agentHost: canonicalize missing paths through all ancestors#332668
Connor Peet (connor4312) merged 1 commit into
mainfrom
connor4312/agent-host-canonicalize-ancestors

Conversation

@connor4312

Copy link
Copy Markdown
Member

agentHost: canonicalize missing paths through all ancestors

The resource service now walks parent directories until it finds an
existing path. It then applies realpath to that ancestor and appends
the missing suffix before the grant check.

  • Walks ancestors in _canonicalize instead of only the immediate parent
  • Adds a unit test for nested missing paths through a directory symlink
  • Keeps coverage for new files that stay inside the granted tree

(Commit message generated by Copilot)

The resource service now walks parent directories until it finds an
existing path. It then applies realpath to that ancestor and appends
the missing suffix before the grant check.

- Walks ancestors in _canonicalize instead of only the immediate parent
- Adds a unit test for nested missing paths through a directory symlink
- Keeps coverage for new files that stay inside the granted tree

(Commit message generated by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings August 26, 2026 01:19
@connor4312
Connor Peet (connor4312) enabled auto-merge (squash) August 26, 2026 01:20

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

Updates resource permission checks to canonicalize nested missing paths through existing ancestors.

Changes:

  • Walks ancestors until realpath succeeds.
  • Adds symlink and granted-tree regression coverage.
Show a summary per file
File Description
agentHostResourceService.ts Canonicalizes missing path suffixes.
agentHostResourceService.test.ts Tests nested missing paths through symlinks.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Balanced

@saroasid-web

Copy link
Copy Markdown

تم

@connor4312
Connor Peet (connor4312) merged commit 07a6037 into main Aug 26, 2026
38 checks passed
@connor4312
Connor Peet (connor4312) deleted the connor4312/agent-host-canonicalize-ancestors branch August 26, 2026 02:36
@vs-code-engineering vs-code-engineering Bot added this to the 1.136.0 milestone Aug 26, 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.

4 participants