fix(skill_view): exclude skill-internal subdirs from Strategy 3 legacy file matching - #39677
Closed
111-test-111 wants to merge 1 commit into
Closed
Conversation
…y file matching Strategy 3 uses rglob to find legacy flat <name>.md files anywhere under the skills directory. This incorrectly matched files inside skill-internal subdirectories (references/, templates/, scripts/, assets/) — e.g., a skill's references/native-mcp.md was treated as a standalone legacy skill, causing a false collision with the real mcp/native-mcp skill. Fix: skip any file whose path contains a skill-internal subdirectory component. These directories are reserved for supporting documents within existing skills and should never contain standalone legacy skills. Includes regression test reproducing the original native-mcp collision and parametrized tests for all four excluded subdirectory names.
Collaborator
Contributor
|
Thanks for the focused regression report and tests. This is already implemented on current
|
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.
Problem
Strategy 3 in uses to find legacy flat files anywhere under the skills directory. This incorrectly matches files inside skill-internal subdirectories like
references/,templates/,scripts/,assets/.Real-world example: A user has both:
mcp/native-mcp/SKILL.md— a standalone MCP skillautonomous-ai-agents/hermes-agent/references/native-mcp.md— a reference doc inside the hermes-agent skillCalling
skill_view("native-mcp")finds both via Strategy 3's rglob and throws anAmbiguous skill nameerror, even though the reference doc is clearly not a standalone skill.Fix
Add a check in Strategy 3 to skip any file whose path contains a skill-internal subdirectory component (
references,templates,scripts,assets). These directories are reserved for supporting documents within existing skills and should never contain standalone legacy skills.Tests
native-mcpcollision scenario