Farhan Beg commited on
Commit Β·
70042cf
1
Parent(s): 69b7182
fix(config): strip deprecated TERMINAL_CWD from .env on boot
Browse filesHermes v0.17.0 deprecated TERMINAL_CWD in favor of config.yaml's
terminal.cwd and warns on every gateway start:
'Deprecated .env settings detected: TERMINAL_CWD=/opt/data/workspace'
config.yaml already has terminal.cwd set correctly (line 295), so the
.env entry is pure cruft. It's excluded from HF Dataset backup
(hermes-sync.py EXCLUDED_TOP_LEVEL), but the dashboard Env tab / older
Hermes versions can re-add it at runtime. Strip it on every boot right
after config.yaml is written so the warning stays gone.
314 unmodified lines315316317318319320314 unmodified linespath.write_text(yaml.safe_dump(config, sort_keys=False), encoding="utf-8")path.chmod(0o600)PY# ββ Startup summary βββββββββββββββββββββββββββββββββββββββββββββββββββ314 unmodified lines315316317318319320321322323324325326327328329330331332333334335336337314 unmodified linespath.write_text(yaml.safe_dump(config, sort_keys=False), encoding="utf-8")path.chmod(0o600)# config.yaml now carries terminal.cwd (above), so TERMINAL_CWD in .env is# redundant. Hermes v0.17.0 deprecated it and warns on every gateway# start ("Deprecated .env settings detected: TERMINAL_CWD=..."). The# dashboard Env tab / older Hermes versions may re-add it; strip it on# every boot so the warning stays gone.env_file = home / ".env"if env_file.exists():try:lines = env_file.read_text(encoding="utf-8", errors="replace").splitlines()kept = [ln for ln in lines if not ln.strip().startswith("TERMINAL_CWD=")]if len(kept) != len(lines):env_file.write_text("\n".join(kept).rstrip() + "\n", encoding="utf-8")env_file.chmod(0o600)print(f"Removed deprecated TERMINAL_CWD from {env_file}")except OSError as exc:print(f"Warning: could not clean {env_file}: {exc}")PY# ββ Startup summary βββββββββββββββββββββββββββββββββββββββββββββββββββ
start.sh+17