Skip to content

The agent that grows with you

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.py
index 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) == count
leaks = []
+ backups = home / 'backups' / 'config' # copies of config.yaml itself (#109463), not a daemon leak
for 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, leaks
return {'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.py
index 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() == snapshots
assert 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.parents
and any(k.encode() in p.read_bytes() for k in keys.values())]
assert not leaks, leaks
return {'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.py
index 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() + timeout
while time.monotonic() < deadline:
for frame in _frames(out):