fix(desktop): default HERMES_DESKTOP_CWD to cwd when --cwd omitted

Salvaged from #40363; re-verified on main, tightened, tested.

Co-authored-by: alex-heritier <alex-heritier@users.noreply.github.com>
This commit is contained in:
teknium1 2026-06-06 08:50:11 -07:00 committed by Teknium
parent 077419b220
commit 5431bf2921

View file

@ -5598,6 +5598,8 @@ def cmd_gui(args: argparse.Namespace):
env["HERMES_DESKTOP_HERMES_ROOT"] = str(Path(args.hermes_root).expanduser().resolve())
if getattr(args, "cwd", None):
env["HERMES_DESKTOP_CWD"] = str(Path(args.cwd).expanduser().resolve())
else:
env["HERMES_DESKTOP_CWD"] = os.getcwd()
# Desktop launch options from config.yaml (`desktop.electron_flags`,
# `desktop.disable_gpu`). The GPU policy is bridged to the env var the