From bbdb14db4cebf08fcad4f938369df14b307070a9 Mon Sep 17 00:00:00 2001 From: fwazb Date: Sat, 25 Jul 2026 11:03:22 -0700 Subject: [PATCH] Clear Hermes side-effect env vars before no-send bootstrap --- ops/gcp_leoclean_nosend_prompt_ingress.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ops/gcp_leoclean_nosend_prompt_ingress.py b/ops/gcp_leoclean_nosend_prompt_ingress.py index 6281979..b6450ca 100644 --- a/ops/gcp_leoclean_nosend_prompt_ingress.py +++ b/ops/gcp_leoclean_nosend_prompt_ingress.py @@ -422,6 +422,12 @@ def execute(prompt_id: str, provider_secret: str) -> dict[str, Any]: from hermes_cli.tools_config import _get_platform_tools # noqa: F401,E402 from run_agent import AIAgent # noqa: F401,E402 + # The imports above set HERMES_EXEC_ASK, HERMES_MAX_ITERATIONS, HERMES_QUIET + # as side effects. The no-send contract rejects these. Clear them before + # bootstrap validates the environment. + for key in ("HERMES_EXEC_ASK", "HERMES_MAX_ITERATIONS", "HERMES_QUIET"): + os.environ.pop(key, None) + bootstrap = _load_module("livingip_m5_runtime_bootstrap", BOOTSTRAP) contract, config, _surface, _policy = bootstrap._prepare(PROFILE, template=False) _require(contract.get("runtime_mode") == "gcp_staging_no_send", "runtime mode was not no-send staging")