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.
This commit is contained in:
jonny 2026-04-10 09:18:06 +00:00
parent 660379637a
commit 294c377c0c

View file

@ -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