FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

.NET: [Breaking] Refactor AgentFileSkillsSource for depth-based discovery and predicate filters by semenshi · Pull Request #6109 · microsoft/agent-framework · GitHub

Repository navigation

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

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

semenshi-m (semenshi) merged 2 commits into
microsoft:mainfrom
semenshi:refactor/agent-file-skill-filter-context

Conversation

Copy link
Copy Markdown
Contributor

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

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

Evan Mattson (moonbox3) added the .NET Usage: [Issues, PRs], Target: .Net label May 27, 2026

Copy link
Copy Markdown
Contributor

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 ⏱️

…ebug output

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
semenshi-m (semenshi) added this pull request to the merge queue May 28, 2026
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 28, 2026
semenshi-m (semenshi) added this pull request to the merge queue May 28, 2026
semenshi-m (semenshi) removed this pull request from the merge queue due to a manual request May 28, 2026
semenshi-m (semenshi) added this pull request to the merge queue May 28, 2026
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 28, 2026
semenshi-m (semenshi) added this pull request to the merge queue May 28, 2026
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 28, 2026
semenshi-m (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
pull Bot pushed a commit to nagyist/ms-agent-framework that referenced this pull request Jun 24, 2026
…y and predicate filters (microsoft#6488)

* Python: [Breaking] Refactor FileSkillsSource for depth-based discovery and predicate filters

Refactors FileSkillsSource to make script and resource discovery more flexible.

## Changes

- **Drops** resource_directories / script_directories options (preconfigured
  directory whitelists).
- **Adds** search_depth option (>= 1, default 2): controls how deep the
  recursive scan goes within each skill directory.
- **Adds** script_filter / resource_filter predicate options that receive a
  FileSkillFilterContext (skill_name + relative_file_path), allowing
  whitelist/blacklist filtering by file path.
- **Adds** FileSkillFilterContext class exported from agent_framework.

## Notes

- The Skills API is marked @experimental -- the option removals are intentional
  breaking changes within the experimental surface.
- Security checks (path containment, symlink detection) are preserved and
  continue to use the skill root directory as the trusted boundary.
- Ports the same refactoring from .NET PR microsoft#6109 while following Python
  conventions (instance methods, Callable type hints, __slots__).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address PR feedback: clarify depth constants and skip nested skill directories

- Add clarifying comments distinguishing MAX_SEARCH_DEPTH (SKILL.md
  discovery) from DEFAULT_SEARCH_DEPTH (per-skill resource/script scanning).
- Stop recursing into subdirectories that contain their own SKILL.md,
  preventing child skill files from being attached to the parent skill.
- Add test verifying nested skill boundary is respected.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove __slots__ from FileSkillFilterContext and add type-ignore comments

- Remove __slots__ from FileSkillFilterContext per reviewer feedback —
  the optimization is negligible and inconsistent with sibling classes.
- Add type: ignore[attr-defined] / ty: ignore[unresolved-attribute]
  comments to test lines accessing private _resources/_scripts attributes,
  matching the convention established on main.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Simplify filter predicates: remove FileSkillFilterContext, use Callable[[str, str], bool]

Address reviewer feedback:
- Remove FileSkillFilterContext class — a dedicated class for two strings
  is overkill in Python. Filters now receive (skill_name, relative_file_path)
  directly as positional args.
- Update docstrings to describe behavior instead of referencing private
  instance attributes.
- Remove FileSkillFilterContext from exports and __all__.
- Update all test lambdas and remove TestFileSkillFilterContext class.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Use DEFAULT_SEARCH_DEPTH as default argument directly

Instead of accepting int | None and resolving None to the default
internally, use DEFAULT_SEARCH_DEPTH as the parameter default value
on both FileSkillsSource.__init__() and SkillsProvider.from_paths().

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

This branch was previously deployed

1 inactive deployment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

.NET Usage: [Issues, PRs], Target: .Net

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL