test: let the blocked-provider test run out of 4xx retries

This commit is contained in:
Ian 2026-10-07 18:19:33 -04:00
parent 37832bc465
commit c3fc173137

View file

@ -96,8 +96,12 @@ async def test_blocked_provider_failure_text_carries_request_id(
monkeypatch: pytest.MonkeyPatch,
) -> None:
coordinator = AgentCoordinator()
# 4xx errors are retried, so the block repeats until retries run out.
streams = [
_FakeStream(exc=_blocked_error()) for _ in range(execution._MAX_TRANSIENT_MODEL_RETRIES + 1)
]
with pytest.raises(PermissionDeniedError):
await _run(monkeypatch, [_FakeStream(exc=_blocked_error())], coordinator)
await _run(monkeypatch, streams, coordinator)
assert coordinator.statuses["root"] == "failed"
error = coordinator.errors["root"]
assert "Output blocked by policy" in error