Skip to content

fix(skills): resolve external_dirs relative to HERMES_HOME, not cwd (salvage #9966)#17289

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-9d57430b
Apr 29, 2026
Merged

fix(skills): resolve external_dirs relative to HERMES_HOME, not cwd (salvage #9966)#17289
teknium1 merged 1 commit into
mainfrom
hermes/hermes-9d57430b

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Salvages #9966 from @Magicray1217.

Closes #9949.

Summary

Relative entries in skills.external_dirs (e.g. ../shared-skills) now resolve consistently against HERMES_HOME, regardless of which directory hermes was launched from.

Root cause

agent/skill_utils.py:213 did Path(expanded).resolve(), which resolves relative paths against the process cwd. Same config worked from one launch directory and silently failed from another (CLI vs gateway vs cron vs subprocess all see different cwds).

Fix

For non-absolute entries, resolve against get_hermes_home() instead of cwd. Absolute paths and ~ / ${VAR} expansion are unchanged.

Validation

  • tests/agent/test_external_skills.py — 11/11 pass
  • E2E reproducing the issue: config.yaml with external_dirs: [../shared-skills], sibling shared-skills/ directory, hermes launched from a third unrelated dir → resolves to <HERMES_HOME>/../shared-skills correctly (was returning [] before).

Credit

@Magicray1217 authored the fix in #9966. Cherry-picked onto current main with authorship preserved.

)

Relative entries in skills.external_dirs were resolved against the
process cwd via Path.resolve(), making them silently fail when Hermes
was launched from a different directory.

Resolve relative paths against get_hermes_home() for consistent
behavior across CLI, gateway, and cron contexts. Absolute paths
and env-var/tilde expansion are unchanged.
@teknium1 teknium1 merged commit 8860237 into main Apr 29, 2026
11 of 12 checks passed
@teknium1 teknium1 deleted the hermes/hermes-9d57430b branch April 29, 2026 05:29
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent loop, run_agent.py, prompt builder tool/skills Skills system (list, view, manage) area/config Config system, migrations, profiles labels Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/agent Core agent loop, run_agent.py, prompt builder 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.

skills.external_dirs relative paths depend on process cwd instead of config location

3 participants