Skip to content

Commit 776f894

Browse files
committed
fix: isolate test env from host CLAUDE_*/CODEX_* variables
- test_runtime_gate: clear env in preflight payload discovery test - check-prompt-runtime-gate-smoke: filter CLAUDE_*/CODEX_* vars in subprocess env Fixes 2 pre-existing failures caused by ambient env variable leakage into _detect_current_host_id_from_env().
1 parent f7fdc17 commit 776f894

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

scripts/check-prompt-runtime-gate-smoke.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ def _run_gate_scenario(
315315

316316
def _run_gate_cli(*, workspace: Path, home_root: Path, request: str) -> tuple[dict[str, Any], int]:
317317
script_path = REPO_ROOT / "scripts" / "runtime_gate.py"
318-
env = dict(os.environ)
318+
env = {k: v for k, v in os.environ.items() if not k.startswith(("CLAUDE_", "CODEX_"))}
319319
env["HOME"] = str(home_root)
320320
completed = subprocess.run(
321321
[

tests/test_runtime_gate.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,8 @@ def test_gate_preflight_uses_user_home_for_payload_discovery(self) -> None:
10561056
embedded_home = temp_root / "embedded-home"
10571057
_install_payload_manifest_for_gate(home_root=embedded_home)
10581058

1059-
with patch("runtime.workspace_preflight.Path.home", return_value=real_home):
1059+
with patch.dict(os.environ, {}, clear=True), \
1060+
patch("runtime.workspace_preflight.Path.home", return_value=real_home):
10601061
result = enter_runtime_gate(
10611062
"~go plan demo",
10621063
workspace_root=workspace,

0 commit comments

Comments
 (0)