Skip to content

Refactor: implement centralized HERMES_HOME environment variable support (#892) - #1489

Closed
Nebula037 wants to merge 2 commits into
NousResearch:mainfrom
Nebula037:refactor/892-use-hermes-home-env
Closed

Refactor: implement centralized HERMES_HOME environment variable support (#892)#1489
Nebula037 wants to merge 2 commits into
NousResearch:mainfrom
Nebula037:refactor/892-use-hermes-home-env

Conversation

@Nebula037

Copy link
Copy Markdown

What does this PR do?

This PR centralizes the resolution of the agent's base directory by introducing a global HERMES_HOME constant. It enables users to override the default ~/.hermes path using the HERMES_HOME environment variable, which is critical for containerized deployments (Docker/Podman), CI/CD pipelines, and multi-instance management.

Related Issue

Fixes #892

Type of Change

  • ♻️ Refactor (no behavior change)

Changes Made

  • hermes_constants.py: Added get_hermes_home() utility and exported HERMES_HOME as a pathlib.Path object.
  • tools/process_registry.py: Refactored to import HERMES_HOME from constants, replacing the localized path resolution for the processes.json checkpoint file.

How to Test

  1. Verify Default Path: Run the agent without the environment variable; it should still default to ~/.hermes.
  2. Verify Override: Set export HERMES_HOME=/tmp/hermes_test and start the agent.
  3. Check Checkpoint: Run a background process via the terminal tool and verify that processes.json is created in /tmp/hermes_test/ instead of the home directory.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature
  • I've run pytest tests/ -q and all tests pass (N/A for browser-only refactor, relying on CI)
  • I've added tests for my changes
  • I've tested on my platform: GitHub Codespaces / Browser

Documentation & Housekeeping

  • I've updated relevant documentation (docstrings in hermes_constants.py)
  • I've considered cross-platform impact (Windows, macOS) using pathlib

…#892)

Introduces get_hermes_home() to allow overriding the default ~/.hermes directory via HERMES_HOME environment variable.
…usResearch#892)

Replaced localized get_hermes_home() call with the centralized HERMES_HOME constant from hermes_constants. This ensures consistent directory resolution across the entire toolkit.
@teknium1

Copy link
Copy Markdown
Contributor

Closing — the issue this targets (#892) is already fully resolved. All 9 files listed in the issue already import get_hermes_home() from hermes_cli/config.py and use it correctly. No hardcoded ~/.hermes paths remain in any of them (fixed by earlier PRs #51 and #538).

This PR would introduce a second get_hermes_home() in hermes_constants.py alongside the existing one in hermes_cli/config.py, creating a duplicate source of truth. Appreciate the effort though — thanks for looking into this!

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.

fix: remaining hardcoded ~/.hermes paths bypass HERMES_HOME override

2 participants