From d2e64fcb89cd180c6657bbe60723980fc5498778 Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Thu, 9 Jul 2026 16:45:15 -0700 Subject: [PATCH] fix(cli): widen --yolo env guarantee to the _prepare_agent_startup chokepoint + AUTHOR_MAP The salvaged fix sets HERMES_YOLO_MODE in main()'s dispatch path before _prepare_agent_startup(); this follow-up also sets it inside _prepare_agent_startup() itself so every launcher that triggers plugin/tool discovery (incl. the Termux fast-CLI path) gets the same ordering guarantee before tools.approval freezes _YOLO_MODE_FROZEN (#60328). --- hermes_cli/main.py | 9 +++++++++ scripts/release.py | 1 + 2 files changed, 10 insertions(+) diff --git a/hermes_cli/main.py b/hermes_cli/main.py index f4356f2c62a..9e5267fe428 100644 --- a/hermes_cli/main.py +++ b/hermes_cli/main.py @@ -12414,6 +12414,15 @@ def _should_background_mcp_startup(args) -> bool: def _prepare_agent_startup(args) -> None: """Discover plugins/MCP/hooks for commands that can run an agent turn.""" + # --yolo: chokepoint guarantee that HERMES_YOLO_MODE is set before ANY + # plugin/tool discovery below imports tools.approval, which freezes + # _YOLO_MODE_FROZEN at import time (PR #7994 security design). main()'s + # dispatch path also sets this earlier, but _prepare_agent_startup() is + # reachable from other launchers too (e.g. the Termux fast-CLI path), + # so the guarantee lives here where the import is actually triggered + # (#60328). + if getattr(args, "yolo", False): + os.environ["HERMES_YOLO_MODE"] = "1" _apply_safe_mode(args) _sub_attr, _sub_set = _AGENT_SUBCOMMANDS.get(args.command, (None, None)) diff --git a/scripts/release.py b/scripts/release.py index 788cb157bfd..4957e53a670 100755 --- a/scripts/release.py +++ b/scripts/release.py @@ -299,6 +299,7 @@ AUTHOR_MAP = { "290859878+synapsesx@users.noreply.github.com": "synapsesx", "157689911+itsflownium@users.noreply.github.com": "itsflownium", "dirtyren@users.noreply.github.com": "dirtyren", + "chenkun_lws@126.com": "bytesnail", # PR #60360 salvage (--yolo startup ordering; #60328) "iamgexin@qq.com": "nullptr0807", # PR #60956 salvage (gateway hygiene in-place compaction; #60947) "embwl0x@users.noreply.github.com": "embwl0x", # PR #60810 salvage (channel directory offload) "caztronics@yahoo.com": "doncazper",