From 294c377c0c57aabbe545b62d4bfd7980c583dc18 Mon Sep 17 00:00:00 2001 From: jonny Date: Fri, 10 Apr 2026 09:18:06 +0000 Subject: [PATCH] fix(tui): use PROJECT_ROOT instead of cwd for HERMES_ROOT fallback When HERMES_ROOT was added for Nix-bundled TUI support, the fallback was set to os.getcwd(). This overrode the TUI's own import.meta.dirname resolution, so launching `hermes --tui` from outside the repo caused the gateway client to look for venv/bin/python relative to the user's working directory instead of the repo root. Use PROJECT_ROOT (resolved from the source file location) as the fallback, which is stable regardless of where the command is invoked. --- hermes_cli/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hermes_cli/main.py b/hermes_cli/main.py index e7455608c..2ccd1ba9c 100644 --- a/hermes_cli/main.py +++ b/hermes_cli/main.py @@ -663,7 +663,7 @@ def _launch_tui(resume_session_id: Optional[str] = None): tui_dir = PROJECT_ROOT / "ui-tui" env = os.environ.copy() - env["HERMES_ROOT"] = os.environ.get("HERMES_ROOT", os.getcwd()) + env["HERMES_ROOT"] = os.environ.get("HERMES_ROOT", str(PROJECT_ROOT)) if resume_session_id: env["HERMES_TUI_RESUME"] = resume_session_id