Skip to content

.NET: [Breaking] Refactor AgentFileSkillsSource for depth-based discovery and predicate filters#6109

Merged
semenshi merged 2 commits into
microsoft:mainfrom
semenshi:refactor/agent-file-skill-filter-context
May 28, 2026
Merged

.NET: [Breaking] Refactor AgentFileSkillsSource for depth-based discovery and predicate filters#6109
semenshi merged 2 commits into
microsoft:mainfrom
semenshi:refactor/agent-file-skill-filter-context

Conversation

@semenshi
Copy link
Copy Markdown
Collaborator

Refactors AgentFileSkillsSource to make script and resource discovery more flexible.

Changes

  • Drops ScriptDirectories / ResourceDirectories options (preconfigured directory whitelists).
  • Adds SearchDepth option (>= 1, default 2): controls how deep the recursive scan goes within each skill directory.
  • Adds ScriptFilter / ResourceFilter predicate options that receive an AgentFileSkillFilterContext (SkillName + RelativeFilePath), allowing whitelist/blacklist filtering by file path.

Notes

  • The options surface is marked [Experimental] -- the option removals are intentional.
  • Security checks (path containment, symlink detection, reparse-point skipping) are preserved and continue to use the skill root directory as the trusted boundary.
  • All 2888 unit tests pass.

…FileSkillFilterContext

- Replace hardcoded script/resource directory lists with configurable ScriptFilter and ResourceFilter predicates
- Add AgentFileSkillFilterContext class to provide contextual file information to filter predicates
- Replace MaxSearchDepth constant with configurable SearchDepth option
- Update AgentFileSkillsSourceOptions with new filter and search depth properties
- Update tests to reflect the new filtering approach

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 27, 2026 12:08
Copy link
Copy Markdown
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.

Copilot wasn't able to review any files in this pull request.

@moonbox3
Copy link
Copy Markdown
Contributor

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
TOTAL36634433388% 
report-only-changed-files is enabled. No files were changed during this commit :)

Python Unit Test Overview

Tests Skipped Failures Errors Time
7287 34 💤 0 ❌ 0 🔥 1m 57s ⏱️

@semenshi semenshi enabled auto-merge May 27, 2026 16:18
Comment thread dotnet/src/Microsoft.Agents.AI/Skills/File/AgentFileSkillsSource.cs Outdated
…ebug output

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@semenshi semenshi added this pull request to the merge queue May 28, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 28, 2026
@semenshi semenshi added this pull request to the merge queue May 28, 2026
@semenshi semenshi removed this pull request from the merge queue due to a manual request May 28, 2026
@semenshi semenshi added this pull request to the merge queue May 28, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 28, 2026
@semenshi semenshi added this pull request to the merge queue May 28, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 28, 2026
@semenshi semenshi added this pull request to the merge queue May 28, 2026
Merged via the queue into microsoft:main with commit 3ee1bb4 May 28, 2026
26 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in Agent Framework May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants