From 206e56cc5e0d799ab3a824185b8dc0be65fe888f Mon Sep 17 00:00:00 2001 From: teknium1 Date: Fri, 13 Mar 2026 21:35:07 -0700 Subject: [PATCH] fix: finish HERMES_HOME path cleanup - route CLI interrupt debug logging through HERMES_HOME - update the remaining channel_directory test to patch HERMES_HOME instead of Path.home() --- cli.py | 6 ++---- tests/gateway/test_channel_directory.py | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/cli.py b/cli.py index 0c0594500..408df5d58 100755 --- a/cli.py +++ b/cli.py @@ -3684,8 +3684,7 @@ class HermesCLI: self.agent.interrupt(interrupt_msg) # Debug: log to file (stdout may be devnull from redirect_stdout) try: - import pathlib as _pl - _dbg = _pl.Path.home() / ".hermes" / "interrupt_debug.log" + _dbg = _hermes_home / "interrupt_debug.log" with open(_dbg, "a") as _f: import time as _t _f.write(f"{_t.strftime('%H:%M:%S')} interrupt fired: msg={str(interrupt_msg)[:60]!r}, " @@ -3993,8 +3992,7 @@ class HermesCLI: self._interrupt_queue.put(payload) # Debug: log to file when message enters interrupt queue try: - import pathlib as _pl - _dbg = _pl.Path.home() / ".hermes" / "interrupt_debug.log" + _dbg = _hermes_home / "interrupt_debug.log" with open(_dbg, "a") as _f: import time as _t _f.write(f"{_t.strftime('%H:%M:%S')} ENTER: queued interrupt msg={str(payload)[:60]!r}, " diff --git a/tests/gateway/test_channel_directory.py b/tests/gateway/test_channel_directory.py index 74c95213d..2ecacc457 100644 --- a/tests/gateway/test_channel_directory.py +++ b/tests/gateway/test_channel_directory.py @@ -203,7 +203,7 @@ class TestBuildFromSessions: }, }) - with patch.object(Path, "home", return_value=tmp_path): + with patch.dict(os.environ, {"HERMES_HOME": str(tmp_path)}): entries = _build_from_sessions("telegram") ids = {entry["id"] for entry in entries}