fix(fallback): trigger eager fallback on 503/529 provider overload#15666
Open
pazyork wants to merge 1 commit into
Open
fix(fallback): trigger eager fallback on 503/529 provider overload#15666pazyork wants to merge 1 commit into
pazyork wants to merge 1 commit into
Conversation
Collaborator
Collaborator
|
Likely duplicate of #11034 |
Author
|
@alt-glitch same author as #11492 — rebased on main after Independent block is intentional: overloaded ≠ rate_limit, credential rotation can't fix provider overload. #14055 is complementary (message-pattern path vs status-code path). |
When a provider returns 503 (Service Unavailable) or 529 (Overloaded), the agent should fall back to an alternate provider immediately. Credential-pool rotation cannot fix provider-side overload — rotating keys against the same overloaded servers is useless. Two minimal changes: 1. error_classifier: set should_fallback=True for 503/529 (consistent with rate_limit and billing classifications) 2. run_agent: add independent eager-fallback block for overloaded, placed after the rate-limit pool-rotation deferral block. Overloaded bypasses the _pool_may_recover_from_rate_limit check because credential rotation cannot resolve provider-side capacity issues. More focused than adding overloaded to the is_rate_limited tuple and complementary to NousResearch#14055 (message-pattern classification path).
4ec6c22 to
b5bc45a
Compare
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.
(Continuation of #11492 — rebased on main, couldn't reopen the old PR after force-push.)
When a provider returns 503/529 (overloaded), Hermes should fall back to another provider. Currently it doesn't — two small things are missing:
error_classifier.py: 503/529 doesn't setshould_fallback=Truerun_agent.py: even if it did, the credential-pool check would block fallback (rotation can't fix provider overload)Fix
503/529→should_fallback=True(1 line)Why a separate block: overloaded isn't a rate limit, and credential rotation can't fix a saturated provider. Separate = zero risk to existing rate-limit/billing logic.
What this does NOT touch
is_rate_limitedtuple — unchanged (still only rate_limit + billing)_pool_may_recover_from_rate_limit— unchangedRelated
_pool_may_recover_from_rate_limit)4 files, +27/-1 lines.