Skip to content

fix(hermes): respect $HERMES_HOME env var for profile-mode skills dir#3334

Open
samson-mak wants to merge 1 commit into
github:mainfrom
samson-mak:fix/hermes-profile-skills-dir
Open

fix(hermes): respect $HERMES_HOME env var for profile-mode skills dir#3334
samson-mak wants to merge 1 commit into
github:mainfrom
samson-mak:fix/hermes-profile-skills-dir

Conversation

@samson-mak

Copy link
Copy Markdown

Problem

The Hermes integration hardcodes ~/.hermes/skills/ in _hermes_home_skills_dir():

return Path.home() / ".hermes" / "skills"

This breaks when Hermes runs under a non-default profile, where $HERMES_HOME points to ~/.hermes/profiles/<name>/ and skills live under $HERMES_HOME/skills/.

Fix

Check HERMES_HOME env var first, fall back to ~/.hermes/skills:

hermes_home = os.environ.get("HERMES_HOME")
if hermes_home:
    return Path(hermes_home) / "skills"
return Path.home() / ".hermes" / "skills"

Matches Hermes internal get_skills_dir()get_hermes_home() / "skills".

Testing

  • HERMES_HOME set → skills install to profile dir, visible via hermes skills list
  • HERMES_HOME unset → falls back to ~/.hermes/skills, existing behaviour preserved

The Hermes integration hardcoded ''~/.hermes/skills/'', which breaks when
Hermes runs under a non-default profile (where skills live under
''$HERMES_HOME/skills''). Check the HERMES_HOME environment variable first,
falling back to ''~/.hermes/skills'' for the default (non-profile) install.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Hermes integration’s global skills directory resolution to support Hermes “profile mode” by honoring the HERMES_HOME environment variable, while preserving the existing ~/.hermes/skills fallback when HERMES_HOME is unset.

Changes:

  • Add os import to read environment variables.
  • Update _hermes_home_skills_dir() to prefer $HERMES_HOME/skills and fall back to ~/.hermes/skills.
Show a summary per file
File Description
src/specify_cli/integrations/hermes/init.py Adjusts Hermes skills directory resolution to respect HERMES_HOME for profile-mode installs.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 2
  • Review effort level: Low

Comment on lines +62 to 65
hermes_home = os.environ.get("HERMES_HOME")
if hermes_home:
return Path(hermes_home) / "skills"
return Path.home() / ".hermes" / "skills"
Comment on lines +62 to +64
hermes_home = os.environ.get("HERMES_HOME")
if hermes_home:
return Path(hermes_home) / "skills"

@mnriem mnriem left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address Copilot feedback

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants