Files
hermes-agent/tests/agent
liuhao1024 8530d81b55 fix(credential-pool): treat rotate-to-self after mark as no-recovery
mark_exhausted_and_rotate benched the failed entry, then _select_unlocked
could hand the very same entry straight back (the auth-store sync adopted
fresher tokens and cleared the bench mid-selection, or a false-positive
quota probe lifted it). The caller took the non-None result as a successful
rotation and retried the same 429 with no attempt cap: a sole-credential
openai-codex pool on a weekly usage_limit_reached spun at ~2 req/s for
hours, ~11k requests, turn never failed (#97315).

If the post-mark selection returns the just-marked entry, return None so
the failure surfaces and provider fallback / error propagation proceed —
mirroring the single-entry guard on the unmatched-identity branch.
Multi-entry pools still rotate to a healthy sibling. Ported from PR #97328.

Fixes #97315
2026-09-19 09:40:56 -07:00
..