fix(credential-pool): back off repeated exhaustion - #74282
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
Related: #43856. Both implement exponential credential-pool exhaustion backoff for #15296, but this patch preserves the failure streak when a cooldown merely expires while #43856 clears it. These are competing lifecycle semantics, not duplicate patches; maintainer selection is needed. |
Contributor
Author
|
Closing in favour of #43856, same as the earlier #73750 — that PR was opened on 2026-06-11 and changes the same This PR was re-created automatically after I closed the previous one; that was an oversight on my side, not a disagreement with the duplicate call. Suppressing it properly now so it does not come back a third time. |
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 follow-up's lifecycle clarification, credential exhaustion now persists a per-credential failure streak and uses capped exponential cooldowns (for a 429: 1h → 2h → 4h → 8h). Automatic cooldown expiry makes an entry eligible to try again without clearing its streak, so a repeated provider outage no longer falls back to a one-hour retry loop. Genuine credential recovery paths and
reset_statuses()clear the streak; malformed persisted values are safely coerced.Addressing maintainer feedback
No maintainer instruction was posted, but this incorporates the related-work analysis: #15455 (closed) supplied the complete lifecycle behavior, while #43856 (open) was identified as resetting the streak during normal expired-entry selection. This branch preserves the streak across that selection path and resets it only on recovery or an operator reset.
How to test
pytest tests/agent/test_credential_pool.py -q -x --timeout=60— 111 passed.ruff check agent/credential_pool.py tests/agent/test_credential_pool.py— passed.pytest tests/ -q -x --timeout=60suite reaches collection but cannot run in this sandbox because its default Python lacks the optionalfastapianduvicorndashboard dependencies.What platforms tested on