fix(skills): resolve external_dirs relative to HERMES_HOME, not cwd (salvage #9966)#17289
Merged
Conversation
) 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.
2 tasks
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.
Salvages #9966 from @Magicray1217.
Closes #9949.
Summary
Relative entries in
skills.external_dirs(e.g.../shared-skills) now resolve consistently againstHERMES_HOME, regardless of which directory hermes was launched from.Root cause
agent/skill_utils.py:213didPath(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 passconfig.yamlwithexternal_dirs: [../shared-skills], siblingshared-skills/directory, hermes launched from a third unrelated dir → resolves to<HERMES_HOME>/../shared-skillscorrectly (was returning[]before).Credit
@Magicray1217 authored the fix in #9966. Cherry-picked onto current main with authorship preserved.