The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
test(gateway): credential-leak scans exempt the last-known-good config backups
teknium1f9a5ccbd83f4
diff --git a/tests/gateway/fixtures/cli_launch_policy_probe.py b/tests/gateway/fixtures/cli_launch_policy_probe.pyindex 7b2b5592195..d2b2951fc19 100644--- a/tests/gateway/fixtures/cli_launch_policy_probe.py+++ b/tests/gateway/fixtures/cli_launch_policy_probe.py@@ -155,8 +155,10 @@ def probe(tmp_path):asyncio.run(after_restart(desc))assert len(peer.requests) == countleaks = []+ backups = home / 'backups' / 'config' # copies of config.yaml itself (#109463), not a daemon leakfor path in home.rglob('*'):- if path.is_file() and any(key.encode() in path.read_bytes() for key in keys.values()):+ if path.is_file() and backups not in path.parents \+ and any(key.encode() in path.read_bytes() for key in keys.values()):leaks.append(str(path.relative_to(home)))assert not leaks, leaksreturn {'pids': pids, 'requests': count, 'concurrent_policies': True, 'auth_endpoint_model_reasoning': True,diff --git a/tests/gateway/fixtures/config_policy_recovery_probe.py b/tests/gateway/fixtures/config_policy_recovery_probe.pyindex 268ee053bc7..23188e14fb2 100644--- a/tests/gateway/fixtures/config_policy_recovery_probe.py+++ b/tests/gateway/fixtures/config_policy_recovery_probe.py@@ -96,7 +96,11 @@ def probe(tmp_path):asyncio.run(pair(desc, 'denied'))assert policies() == snapshotsassert len(peer.requests) == 4+ # backups/config/ holds byte-exact copies of config.yaml itself (last-known-good recovery,+ # #109463); the invariant here is that the DAEMON never persists credentials elsewhere.+ backups = home / 'backups' / 'config'leaks = [str(p.relative_to(home)) for p in home.rglob('*') if p.is_file() and p != config+ and backups not in p.parentsand any(k.encode() in p.read_bytes() for k in keys.values())]assert not leaks, leaksreturn {'pids': pids, 'requests': 4, 'concurrent_inline_keys': True, 'restart_actual_inference': True,diff --git a/tests/tui_gateway/test_compute_host_turn_protocol.py b/tests/tui_gateway/test_compute_host_turn_protocol.pyindex fb3b034b3a0..0e421aae353 100644--- a/tests/tui_gateway/test_compute_host_turn_protocol.py+++ b/tests/tui_gateway/test_compute_host_turn_protocol.py@@ -25,7 +25,7 @@ def _frames(out: io.StringIO) -> list[dict]:return [json.loads(line) for line in out.getvalue().splitlines() if line.strip()]-def _wait(out: io.StringIO, predicate, timeout: float = 5.0) -> dict:+def _wait(out: io.StringIO, predicate, timeout: float = 20.0) -> dict:deadline = time.monotonic() + timeoutwhile time.monotonic() < deadline:for frame in _frames(out):