The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
test(auth): make the stale-402 witness come from a still-stale writer
kshitijk4poor660085229993
diff --git a/tests/agent/test_credential_pool_profile_oauth_fork.py b/tests/agent/test_credential_pool_profile_oauth_fork.pyindex 556741dc9ba..08416cd7b72 100644--- a/tests/agent/test_credential_pool_profile_oauth_fork.py+++ b/tests/agent/test_credential_pool_profile_oauth_fork.py@@ -766,7 +766,7 @@ def test_stale_terminal_verdict_cannot_kill_peer_token_generation(fleet, borrowefrom agent.credential_pool import STATUS_DEAD, STATUS_EXHAUSTED, load_poolfleet["use"](_profile(fleet, "stale-dead") if borrowed else fleet["root"])- stale, peer = load_pool("anthropic"), load_pool("anthropic")+ stale, stale_billing, peer = load_pool("anthropic"), load_pool("anthropic"), load_pool("anthropic")assert peer.try_refresh_matching(credential_id="abc123").refresh_token == "sk-ant-ort-RT1"stale.mark_exhausted_and_rotate(@@ -780,9 +780,9 @@ def test_stale_terminal_verdict_cannot_kill_peer_token_generation(fleet, borroweselected = stale.select()assert selected is not None and selected.refresh_token == "sk-ant-ort-RT1"- # Only the terminal verdict was scoped to the old pair: a later account-wide- # billing 402 from the same stale writer still applies to the rotated pair.- stale.mark_exhausted_and_rotate(status_code=402, credential_id="abc123")+ # Only the terminal verdict is scoped to the old pair: a later account-wide+ # billing 402 from another still-stale writer applies to the rotated pair.+ stale_billing.mark_exhausted_and_rotate(status_code=402, credential_id="abc123")row = fleet["rows"](fleet["root"])[0]assert row["refresh_token"] == "sk-ant-ort-RT1"assert row["last_status"] == STATUS_EXHAUSTED