mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-17 09:41:58 +00:00
fix(dump): report effective terminal backend in hermes debug
`terminal.backend` in config.yaml is bridged to the TERMINAL_ENV env var, but a TERMINAL_ENV set in .env / the shell overrides config and is what terminal_tool actually uses. The dump printed only the config value, so a user whose agent was jailed in a docker/podman sandbox via a stale TERMINAL_ENV still saw `terminal: local` — hiding the real cause. Report the effective backend and flag when TERMINAL_ENV overrides config.yaml.
This commit is contained in:
parent
60cc42e38b
commit
b2a4766463
1 changed files with 17 additions and 2 deletions
|
|
@ -252,9 +252,24 @@ def run_dump(args):
|
|||
except Exception:
|
||||
profile = "(default)"
|
||||
|
||||
# Terminal backend
|
||||
# Terminal backend — report the EFFECTIVE backend, not just config.yaml.
|
||||
# ``terminal.backend`` in config.yaml is bridged to the TERMINAL_ENV env var,
|
||||
# but a TERMINAL_ENV set directly in .env / the shell overrides config and is
|
||||
# what terminal_tool actually uses (tools/terminal_tool.py reads TERMINAL_ENV).
|
||||
# Reporting only the config value hides that override and sends users chasing
|
||||
# the wrong cause when the agent runs in a docker/podman sandbox even though
|
||||
# config says "local" (and vice-versa). run_dump() has already loaded .env,
|
||||
# so os.environ reflects the real override here.
|
||||
terminal_cfg = config.get("terminal", {})
|
||||
backend = terminal_cfg.get("backend", "local")
|
||||
config_backend = terminal_cfg.get("backend", "local")
|
||||
env_backend = (os.environ.get("TERMINAL_ENV") or "").strip().lower()
|
||||
if env_backend and env_backend != str(config_backend).strip().lower():
|
||||
backend = (
|
||||
f"{env_backend} (TERMINAL_ENV overrides config.yaml "
|
||||
f"terminal.backend={config_backend})"
|
||||
)
|
||||
else:
|
||||
backend = config_backend
|
||||
|
||||
# OpenAI SDK version
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue