Skip to content

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

@0xIbra

Description

@0xIbra

Problem

HERMES_HOME is supported across most of the codebase, and PRs #51 and #538 fixed several inconsistencies. However, a number of files still resolve paths without checking the environment variable — they hardcode ~/.hermes via Path.home() / ".hermes" or os.path.expanduser("~/.hermes/...").

This breaks isolation when running multiple Hermes instances with distinct HERMES_HOME directories (e.g. separate auth, memories, skills, cron jobs per profile).

Files that bypass HERMES_HOME

File Path pattern used
tools/process_registry.py os.path.expanduser("~/.hermes/processes.json")
gateway/pairing.py os.path.expanduser("~/.hermes/pairing")
gateway/sticker_cache.py os.path.expanduser("~/.hermes/sticker_cache.json")
gateway/channel_directory.py Path.home() / ".hermes" / "channel_directory.json"
gateway/config.py Path.home() / ".hermes" / "gateway.json"
gateway/mirror.py Path.home() / ".hermes" / "sessions"
gateway/hooks.py os.path.expanduser("~/.hermes/hooks")
gateway/platforms/base.py os.path.expanduser("~/.hermes/image_cache") (and audio_cache, document_cache)
agent/auxiliary_client.py Path.home() / ".hermes" / "auth.json"

Proposed fix

Replace all hardcoded paths with calls to the existing get_hermes_home() from hermes_cli/config.py (or a shared low-level module if circular imports are a concern). This is the same pattern used by hermes_state.py, cron/scheduler.py, tools/memory_tool.py, and others that already respect HERMES_HOME.

No behavior change for users who don't set HERMES_HOME — the default remains ~/.hermes.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions