Bug
When launching hermes from a project directory (e.g. /mnt/e/Projects/AI/myproject), the terminal always opens in $HOME instead of the launch directory, even when terminal.cwd: "." is set in config.yaml.
Root Cause
Two separate code paths bridge config.yaml terminal settings to TERMINAL_CWD env var:
cli.py (line 335-338): Correctly resolves cwd: "." → os.getcwd() → sets TERMINAL_CWD to the absolute path (e.g. /mnt/e/Projects/AI/myproject)
gateway/run.py (line 132-138): Later imported as a plugin during the same startup. Re-reads the raw cwd: "." from config.yaml and blindly sets os.environ["TERMINAL_CWD"] = ".", overwriting the resolved value.
gateway/run.py (line 208-211): Sees TERMINAL_CWD is ".", treats it as unresolved, falls back to Path.home().
Reproduction
cd /mnt/e/Projects/AI/myproject
hermes chat -q "pwd"
# Shows /home/user instead of /mnt/e/Projects/AI/myproject
Environment
- WSL2 on Windows
terminal.cwd: "." in config.yaml (the default)
terminal.backend: local
Fix
Skip the cwd key in gateway/run.py's terminal env bridge when TERMINAL_CWD is already set to an absolute path. See PR #XXXX.
Bug
When launching
hermesfrom a project directory (e.g./mnt/e/Projects/AI/myproject), the terminal always opens in$HOMEinstead of the launch directory, even whenterminal.cwd: "."is set inconfig.yaml.Root Cause
Two separate code paths bridge
config.yamlterminal settings toTERMINAL_CWDenv var:cli.py(line 335-338): Correctly resolvescwd: "."→os.getcwd()→ setsTERMINAL_CWDto the absolute path (e.g./mnt/e/Projects/AI/myproject)gateway/run.py(line 132-138): Later imported as a plugin during the same startup. Re-reads the rawcwd: "."from config.yaml and blindly setsos.environ["TERMINAL_CWD"] = ".", overwriting the resolved value.gateway/run.py(line 208-211): SeesTERMINAL_CWDis".", treats it as unresolved, falls back toPath.home().Reproduction
Environment
terminal.cwd: "."inconfig.yaml(the default)terminal.backend: localFix
Skip the
cwdkey in gateway/run.py's terminal env bridge whenTERMINAL_CWDis already set to an absolute path. See PR #XXXX.