Clear Hermes side-effect env vars before no-send bootstrap
Some checks are pending
CI / lint-and-test (push) Waiting to run

This commit is contained in:
fwazb 2026-07-25 11:03:22 -07:00
parent 85aa7b346d
commit bbdb14db4c

View file

@ -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")