Skip to content

feat(hermes): honor HERMES_HOME in adapter ConfigPath#978

Open
Cristobalar-1982 wants to merge 1 commit into
Gentleman-Programming:mainfrom
Cristobalar-1982:fix/hermes-windows-home
Open

feat(hermes): honor HERMES_HOME in adapter ConfigPath#978
Cristobalar-1982 wants to merge 1 commit into
Gentleman-Programming:mainfrom
Cristobalar-1982:fix/hermes-windows-home

Conversation

@Cristobalar-1982

@Cristobalar-1982 Cristobalar-1982 commented Jun 27, 2026

Copy link
Copy Markdown

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

  • internal/agents/hermes/adapter.go: add HERMES_HOME override to ConfigPath()
  • internal/agents/hermes/adapter_test.go: cover the new behavior while isolating existing tests from the environment

Summary by CodeRabbit

  • Bug Fixes
    • Configuration now respects the HERMES_HOME environment variable when it is set, while keeping the default location unchanged when it is not.
    • Test setup was tightened to avoid environment-related interference between runs.
  • Tests
    • Added coverage for configuration path behavior with HERMES_HOME set and unset.

Copilot AI review requested due to automatic review settings June 27, 2026 21:40
@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 86dad8e2-db6c-4920-878c-c67b49e2eae7

📥 Commits

Reviewing files that changed from the base of the PR and between 8df34cd and ab048e5.

📒 Files selected for processing (2)
  • internal/agents/hermes/adapter.go
  • internal/agents/hermes/adapter_test.go

📝 Walkthrough

Walkthrough

ConfigPath in the Hermes adapter now checks the HERMES_HOME environment variable and returns it directly when set, falling back to homeDir/.hermes otherwise. Existing tests reset HERMES_HOME to prevent interference, and a new test covers both the override and fallback behaviors.

Changes

HERMES_HOME support in ConfigPath

Layer / File(s) Summary
ConfigPath env override and tests
internal/agents/hermes/adapter.go, internal/agents/hermes/adapter_test.go
ConfigPath returns HERMES_HOME when non-empty, else homeDir/.hermes. Existing tests (TestDetect, TestConfigPaths) reset HERMES_HOME via t.Setenv. New TestConfigPathHERMES_HOME asserts both the override and fallback paths.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the main change: ConfigPath now honors HERMES_HOME.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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_HOME override logic to ConfigPath() in the Hermes adapter.
  • Add focused unit coverage for the new HERMES_HOME behavior.
  • 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.

Comment on lines +164 to +168
// 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
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.

2 participants