Conversation
…ows junctions When HERMES_HOME lives on a directory junction (e.g. C:\Users\...\hermes → D:\hermes), _resolve_lock_install_path() returns the physical path (D:\hermes\skills\<skill>) after .resolve(), but the subsequent relative_to() call compared it against the junction-form skills dir (C:\Users\...\hermes\skills). The drive-letter mismatch makes Path.relative_to() raise ValueError, blocking every skills-hub install. Fix by resolving the base dir too, so both sides compare physical paths. Applies to both the lock-file install_path record and the post-install display path.
teknium1
left a comment
There was a problem hiding this comment.
Thanks for tracing this to the resolved install target versus logical Skills Hub root. Current main still returns a resolved target from tools/skills_hub.py:265-291, then records it relative to unresolved _skills_dir() at tools/skills_hub.py:3824; the CLI repeats the mismatch at hermes_cli/skills_hub.py:740. The two changed bases address those exact paths.
Problems
- The diff has no regression coverage. The existing install E2E at
tests/tools/test_skill_bundle_provenance.py:141-165uses a direct temporaryHERMES_HOME, so it cannot exercise a symlink/junction-root mismatch.
Suggested changes
- Add an E2E test using a logical symlink/junction
HERMES_HOMEpointing to a physical temporary home; assert install completion, a relative lock-fileinstall_path, and successful CLI output.
Automated hermes-sweeper review.
| scan_verdict=scan_result.verdict, | ||
| skill_hash=content_hash(install_dir), | ||
| install_path=str(install_dir.relative_to(_skills_dir())), | ||
| install_path=str(install_dir.relative_to(_skills_dir().resolve())), |
There was a problem hiding this comment.
Please add an E2E regression test with HERMES_HOME pointing through a symlink/junction to a physical temporary home. Assert installation completes and the lock entry remains relative; the current E2E uses a direct home path and cannot cover this resolved-versus-logical-base mismatch.
Summary
Fixes skills-hub installs failing with:
Root cause: When
HERMES_HOMElives on a Windows directory junction (e.g.C:\Users\<user>\AppData\Local\hermes→D:\hermes),_resolve_lock_install_path()returns the physical path (D:\hermes\skills\<skill>) after.resolve(), but the subsequentrelative_to()calls compared it against the junction-form skills dir (C:\Users\<user>\AppData\Local\hermes\skills). The drive-letter mismatch makesPath.relative_to()raiseValueError, blocking every skills-hub install for junction/symlinked-home users.Fix: Resolve the base dir too (
_skills_dir().resolve()/SKILLS_DIR.resolve()), so both sides compare physical paths. Applies to both:tools/skills_hub.py— the lock-fileinstall_pathrecord (install_from_quarantine)hermes_cli/skills_hub.py— the post-install display pathTest Plan
hermes skills install official/security/web-pentestpreviously failed for every skill; now installs successfully (verified with 7 official skills).scripts/run_tests.sh tests/tools/test_skills_hub.py tests/hermes_cli/test_skills_hub.py: 57 passed, 2 pre-existing failures (binary-asset KeyError, unrelated to this change — fails on clean main too).