feat(hermes): honor HERMES_HOME in adapter ConfigPath#978
feat(hermes): honor HERMES_HOME in adapter ConfigPath#978Cristobalar-1982 wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
ChangesHERMES_HOME support in ConfigPath
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Updates the Hermes agent adapter to align gentle-ai’s Hermes configuration directory with Hermes Desktop by honoring the HERMES_HOME environment variable, while preserving the historical ~/.hermes default when HERMES_HOME is unset.
Changes:
- Add
HERMES_HOMEoverride logic toConfigPath()in the Hermes adapter. - Add focused unit coverage for the new
HERMES_HOMEbehavior. - Isolate existing Hermes adapter tests from the ambient environment by clearing
HERMES_HOME.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| internal/agents/hermes/adapter.go | Makes Hermes config directory resolution honor HERMES_HOME before falling back to filepath.Join(homeDir, ".hermes"). |
| internal/agents/hermes/adapter_test.go | Adds tests for HERMES_HOME override and clears env var in existing tests to prevent flakiness. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // ConfigPath returns the Hermes global config directory. It honors the | ||
| // HERMES_HOME environment variable when set (the same override Hermes Desktop | ||
| // itself uses), so that gentle-ai and Hermes agree on where persona/skills/MCP | ||
| // config live. When HERMES_HOME is unset, the historical default of | ||
| // filepath.Join(homeDir, ".hermes") is preserved to avoid changing existing |
Make gentle-ai use the same Hermes home directory Hermes Desktop uses by honoring the HERMES_HOME environment variable in the Hermes adapter.
On Windows, Hermes Desktop stores its config under the Hermes-generated path from get_hermes_home(), which typically resolves to %LOCALAPPDATA%\hermes. Until now, gentle-ai hardcoded ~/.hermes and ignored that, so users had to keep the paths in sync manually.
With this change, ConfigPath() checks HERMES_HOME first. When it is set, all gentle-ai paths for Hermes (SOUL.md, skills, MCP config) resolve to the same directory Hermes already uses. When HERMES_HOME is unset, the historical default (~/.hermes) is preserved, so behavior is unchanged for CLI-only workflows.
Files changed
Summary by CodeRabbit
HERMES_HOMEenvironment variable when it is set, while keeping the default location unchanged when it is not.HERMES_HOMEset and unset.