fix(skills): follow symlinked category dirs consistently#14668
Closed
helix4u wants to merge 1 commit into
Closed
Conversation
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?
Fixes skills discovery when a category directory under
~/.hermes/skills/is a symlink, and makes the main skill scanner paths agree on whichSKILL.mdfiles exist.The root issue was that
agent.skill_utils.iter_skill_index_files()had already been fixed to follow symlinks, buttools/skills_tool.pyandagent/skill_commands.pystill used their ownPath.rglob()scans. That left symlinked category trees invisible toskills_list(),skill_view(name=...), and slash-command scanning, while other skill-index code paths could see a different set of files.This patch moves those remaining scan paths onto the shared symlink-following iterator and makes the
skill_view()not-found hint use the same sort order asskills_list().Related Issue
Fixes #
Type of Change
Changes Made
_find_all_skills()intools/skills_tool.pyfromrglob("SKILL.md")toiter_skill_index_files(..., "SKILL.md")skill_view()scan path onto the same iterator so symlinked category directories resolve normallyagent.skill_commands.scan_skill_commands()onto the same iterator so slash-command scanning matches the main skill index_sort_skills()helper soskills_list()ordering and theskill_view()available-skills hint stay alignedskill_view()not-found hint orderingHow to Test
~/.hermes/skills/pointing outside the local tree, with validSKILL.mdskills under the target directory.skills_list()andskills_list(category="...")include the symlinked skills and category.skill_view(name="...")resolves a skill from that symlinked category, and slash-command scanning also sees it.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs
Validation runs:
source venv/bin/activate && scripts/run_tests.sh -n 4 tests/tools/test_skills_tool.py tests/agent/test_skill_commands.py113 passed in 2.18ssource venv/bin/activate && scripts/run_tests.sh -n 4 tests/agent/test_external_skills.py11 passed in 1.01ssource venv/bin/activate && scripts/run_tests.sh -n 441 failed, 14756 passed, 39 skipped, 206 warnings in 310.74s