Skip to content

fix: respect HERMES_HOME in remaining hardcoded paths - #1233

Merged
teknium1 merged 2 commits into
mainfrom
hermes/hermes-7c22e5c1
Mar 14, 2026
Merged

fix: respect HERMES_HOME in remaining hardcoded paths#1233
teknium1 merged 2 commits into
mainfrom
hermes/hermes-7c22e5c1

Conversation

@teknium1

@teknium1 teknium1 commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Contributor credit

This salvages the substantive commit from #897 by @0xIbra and layers a small follow-up fix on top so the original work is preserved and mergeable on current main.

Test plan

  • python -m pytest tests/gateway/test_channel_directory.py tests/tools/test_clipboard.py -n0 -q
  • temp HERMES_HOME smoke check for touched path resolution
  • python -m pytest tests/ -n0 -q still shows 5 pre-existing failures already present on origin/main:
    • tests/gateway/test_discord_slash_commands.py::test_discord_auto_thread_config_bridge
    • tests/test_managed_server_tool_support.py::TestBaseEnvCompatibility::test_hermes_base_env_managed_server_call_pattern
    • tests/test_managed_server_tool_support.py::TestBaseEnvCompatibility::test_hermes_base_env_uses_get_parser
    • tests/test_quick_commands.py::TestCLIQuickCommands::test_exec_command_runs_and_prints_output
    • tests/test_quick_commands.py::TestCLIQuickCommands::test_quick_command_takes_priority_over_skill_commands

Closes #892
Refs #897

0xIbra and others added 2 commits March 13, 2026 21:32
Several files resolved paths via Path.home() / ".hermes" or
os.path.expanduser("~/.hermes/..."), bypassing the HERMES_HOME
environment variable. This broke isolation when running multiple
Hermes instances with distinct HERMES_HOME directories.

Replace all hardcoded paths with calls to get_hermes_home() from
hermes_cli.config, consistent with the rest of the codebase.

Files fixed:
- tools/process_registry.py (processes.json)
- gateway/pairing.py (pairing/)
- gateway/sticker_cache.py (sticker_cache.json)
- gateway/channel_directory.py (channel_directory.json, sessions.json)
- gateway/config.py (gateway.json, config.yaml, sessions_dir)
- gateway/mirror.py (sessions/)
- gateway/hooks.py (hooks/)
- gateway/platforms/base.py (image_cache/, audio_cache/, document_cache/)
- gateway/platforms/whatsapp.py (whatsapp/session)
- gateway/delivery.py (cron/output)
- agent/auxiliary_client.py (auth.json)
- agent/prompt_builder.py (SOUL.md)
- cli.py (config.yaml, images/, pastes/, history)
- run_agent.py (logs/)
- tools/environments/base.py (sandboxes/)
- tools/environments/modal.py (modal_snapshots.json)
- tools/environments/singularity.py (singularity_snapshots.json)
- tools/tts_tool.py (audio_cache)
- hermes_cli/status.py (cron/jobs.json, sessions.json)
- hermes_cli/gateway.py (logs/, whatsapp session)
- hermes_cli/main.py (whatsapp/session)

Tests updated to use HERMES_HOME env var instead of patching Path.home().

Closes #892

(cherry picked from commit 78ac1bb)
- route CLI interrupt debug logging through HERMES_HOME
- update the remaining channel_directory test to patch HERMES_HOME
  instead of Path.home()
@teknium1
teknium1 merged commit 22990ed into main Mar 14, 2026
1 check failed
@teknium1

Copy link
Copy Markdown
Contributor Author

CI failed on the current shared test baseline, not on this change set. I reproduced the same failures on origin/main with the same xdist-style command:

  • tests/gateway/test_discord_slash_commands.py::test_discord_auto_thread_config_bridge
  • tests/test_quick_commands.py::TestCLIQuickCommands::test_exec_command_runs_and_prints_output
  • tests/test_quick_commands.py::TestCLIQuickCommands::test_quick_command_takes_priority_over_skill_commands

This PR's targeted path-isolation tests pass locally:

  • python -m pytest tests/gateway/test_channel_directory.py tests/tools/test_clipboard.py -n0 -q

Proceeding as a salvage of #897 with contributor credit preserved.

angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
…7c22e5c1

fix: respect HERMES_HOME in remaining hardcoded paths
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…7c22e5c1

fix: respect HERMES_HOME in remaining hardcoded paths
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
…7c22e5c1

fix: respect HERMES_HOME in remaining hardcoded paths
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