Python: Stop skill discovery below skill boundaries - #6685
Python: Stop skill discovery below skill boundaries#6685Lovlace (Lovlace777) wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Stops file-based skill discovery from recursing into subdirectories once a skill boundary (SKILL.md) is found, ensuring nested content remains part of the parent skill rather than being treated as separate skill roots.
Changes:
- Update
FileSkillsSource._discover_skill_directoriesto return immediately after recording a directory containingSKILL.md. - Add a regression test covering a nested
SKILL.mdunder a parent skill boundary.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
python/packages/core/agent_framework/_skills.py |
Adds an early return in directory traversal to stop descending below a directory containing SKILL.md. |
python/packages/core/tests/core/test_skills.py |
Adds a regression test asserting nested skill roots are not discovered beneath a parent SKILL.md boundary. |
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||
|
Lovlace (@Lovlace777) please answer the CLA requirement described above to proceed with the PR. |
|
Clean fix! Returning early after finding a SKILL.md prevents descending into nested skill directories. The test with parent-skill containing nested-skill is the perfect regression case. |
|
Lovlace (@Lovlace777) reminder to answer the CLA requirement so we can merge the PR |
|
Closing as fix is no longer valid |
Motivation & Context
Summary
File-based skill discovery currently keeps descending after it finds a
SKILL.md. This can treat content nested beneath a skill boundary as an independent skill root. Stop discovery at the first skill boundary so everything below it remains part of that skill.Description & Review Guide
SKILL.md, and add a regression test with a nestedSKILL.md._discover_skill_directoriesand the regression test structure.Validation
uv run pytest packages/core/tests/core/test_skills.py::TestDiscoverSkillDirectories -q— 7 passed.uv run pytest packages/core/tests/core/test_skills.py -q— passed.uv run poe test -P core— 3350 passed, 30 skipped, 2 xfailed.uv run poe syntax -P core -C— passed.uv run pyright packages/core/agent_framework/_skills.py— 0 errors.uv run pyright -p pyrightconfig.tests.json packages/core/tests/core/test_skills.py— 0 errors.git diff --check— passed.Notes
No public API, dependency, or compatibility changes. The full core Pyright sweep could not resolve locally absent optional Graphviz, OpenTelemetry exporter, Azure Agent Server, and Azure Content Understanding dependencies; focused strict checks for both changed files pass.
Related Issue
Fixes #6682
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and the title prefix in sync automatically.