fix(skills): keep package Markdown from blocking skill loads - #110461
Open
fangliquanflq wants to merge 2 commits into
Open
fix(skills): keep package Markdown from blocking skill loads#110461fangliquanflq wants to merge 2 commits into
fangliquanflq wants to merge 2 commits into
Conversation
This was referenced Sep 14, 2026
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
A valid directory skill can become unloadable when another skill package contains an internal Markdown file with the same basename under an arbitrary directory such as
prompts/. The recursive legacy flat-skill lookup records that internal file as an independent skill and reports a false ambiguity.This change recognizes package ownership structurally: a Markdown candidate is not a legacy flat skill when an ancestor between it and the configured skills root contains
SKILL.md. Genuine root-level and categorized legacy flat skills remain discoverable.Symptom
Calling
skill_view("research")refuses to loadresearch/SKILL.mdwhen another package containsprompts/research.md, returningAmbiguous skill name 'research'.Impact
Users cannot load the intended skill unless they rename otherwise valid internal package content. The affected internal directory names are unbounded, so extending a fixed support-directory list does not solve the bug class.
Bug Cause
Trigger:
tools/skills_tool.py:_collect_skill_candidatesrecursively scans for<name>.mdlegacy candidates.Causal chain:
Why it is wrong: A nested Markdown file is package-owned whenever an ancestor inside the skills root contains
SKILL.md; its immediate directory name does not determine ownership.Working sibling / contrast: Root-level and categorized flat Markdown files without an ancestor directory skill are genuine legacy skills and remain candidates.
Ruled out: Collision refusal itself is not the defect. It remains necessary for genuinely independent same-name skills; the false candidate enters earlier during legacy discovery.
Fix
Exclude legacy Markdown candidates that have an ancestor directory skill, both for direct relative-path lookup and recursive basename lookup. Add regression tests for an internal
prompts/research.mdconflicting with a realresearch/SKILL.mdand for preserving categorized legacy flat skills.Related Issue
Closes #110456
Type of Change
Changes Made
tools/skills_tool.py- detect and exclude package-owned Markdown from legacy skill candidates.tests/tools/test_skills_tool.py- cover arbitrary internal directories and preserve independent categorized legacy skills.How to Test
research/SKILL.mdskill.prompts/research.md.scripts/run_tests.sh tests/tools/test_skills_tool.py -k 'package_owned_markdown or categorized_legacy_flat_markdown' -qand verify both regression tests pass.Checklist
Code
fix(scope):,feat(scope):, etc.)Documentation & Housekeeping
cli-config.yaml.exampleupdates are N/ACONTRIBUTING.mdandAGENTS.mdupdates are N/Apathlibfilesystem operationsScreenshots / Logs
Focused regression result: 2 passed.