fix(credential-pool): back off repeated exhaustion - #73750
Closed
konsisumer wants to merge 1 commit into
Closed
konsisumer wants to merge 1 commit into
konsisumer wants to merge 1 commit into
Conversation
Contributor
Contributor
Author
|
Closing in favour of #43856, which covers the same ground and predates this PR by seven weeks. Both patches add backoff to Nothing here is worth salvaging separately as far as I can tell; if any detail of this diff turns out to be missing from #43856, it is easier to raise it there than to keep a second patch open. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #15296
What changed and why
Per the reporter follow-up on 2026-07-28, credential-pool entries now persist a defensive
consecutive_failurescounter and use a capped exponential cooldown (1h → 2h → 4h → 8h for 429/402-style failures). Automatic expiry makes an entry eligible for another request without clearing its streak, so another exhaustion extends the cooldown instead of returning to the flat base TTL. Fresh-token synchronization, a successful token refresh, andhermes auth resetclear the streak.Addressing maintainer feedback
The related-work review named #15455 (closed) and #43856 (open). This new branch carries forward #15455's required lifecycle behavior—preserving the streak across normal cooldown expiry—and avoids #43856's premature reset during expired-entry selection. It also resets the streak during Anthropic fresh-token synchronization.
How to test
/opt/homebrew/bin/timeout -k 30 480 sh -c 'pytest tests/agent/test_credential_pool.py -q -x --timeout=60 "$@"' sh— passes (111 tests)./opt/homebrew/bin/timeout -k 30 480 sh -c 'pytest tests/ -q -x --timeout=60 "$@"' sh— attempted, but collection is blocked by the environment's missingfastapidependency for dashboard tests; no dependencies were installed.What platforms tested on