Skip to content

fix(skills): follow symlinked category dirs consistently#14668

Closed
helix4u wants to merge 1 commit into
NousResearch:mainfrom
helix4u:codex/fix-symlinked-skill-discovery
Closed

fix(skills): follow symlinked category dirs consistently#14668
helix4u wants to merge 1 commit into
NousResearch:mainfrom
helix4u:codex/fix-symlinked-skill-discovery

Conversation

@helix4u

@helix4u helix4u commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

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 which SKILL.md files exist.

The root issue was that agent.skill_utils.iter_skill_index_files() had already been fixed to follow symlinks, but tools/skills_tool.py and agent/skill_commands.py still used their own Path.rglob() scans. That left symlinked category trees invisible to skills_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 as skills_list().

Related Issue

Fixes #

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✅ Tests (adding or improving test coverage)

Changes Made

  • Switched _find_all_skills() in tools/skills_tool.py from rglob("SKILL.md") to iter_skill_index_files(..., "SKILL.md")
  • Switched the name-based skill_view() scan path onto the same iterator so symlinked category directories resolve normally
  • Switched agent.skill_commands.scan_skill_commands() onto the same iterator so slash-command scanning matches the main skill index
  • Added a shared _sort_skills() helper so skills_list() ordering and the skill_view() available-skills hint stay aligned
  • Added regression tests for symlinked category discovery in both the tool and slash-command scanner paths
  • Added a regression test covering the skill_view() not-found hint ordering

How to Test

  1. Create a category symlink under ~/.hermes/skills/ pointing outside the local tree, with valid SKILL.md skills under the target directory.
  2. Verify skills_list() and skills_list(category="...") include the symlinked skills and category.
  3. Verify skill_view(name="...") resolves a skill from that symlinked category, and slash-command scanning also sees it.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: Ubuntu 24.04

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Screenshots / Logs

Validation runs:

  • source venv/bin/activate && scripts/run_tests.sh -n 4 tests/tools/test_skills_tool.py tests/agent/test_skill_commands.py
    • Passed: 113 passed in 2.18s
  • source venv/bin/activate && scripts/run_tests.sh -n 4 tests/agent/test_external_skills.py
    • Passed: 11 passed in 1.01s
  • source venv/bin/activate && scripts/run_tests.sh -n 4
    • Repo baseline is currently not green: 41 failed, 14756 passed, 39 skipped, 206 warnings in 310.74s
    • Failures were spread across unrelated areas including gateway approval, DingTalk, Discord bot filter, MiniMax provider switching, provider config validation, backup/profile restoration, tips corpus, several Anthropic-path tests, browser/tool registration, Tirith security, write-deny, and zombie cleanup.

@helix4u helix4u marked this pull request as ready for review April 23, 2026 17:53
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists tool/skills Skills system (list, view, manage) labels Apr 23, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Merged via #14740 — your commit was cherry-picked onto current main with authorship preserved in git log (a884f6d). Thanks @helix4u for the clean fix and thorough regression tests!

#14740

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Medium — degraded but workaround exists tool/skills Skills system (list, view, manage) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants