fix(fallback): trigger eager fallback on 503/529 provider overload - #15666
fix(fallback): trigger eager fallback on 503/529 provider overload#15666pazyork wants to merge 1 commit into
Conversation
|
Likely duplicate of #11034 |
|
@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
|
Thanks for this, @pazyork — and for the careful writeup. The underlying bug (overloaded providers not falling back, #10210) was real when you filed, but it's been resolved on current What changed since the PR:
On the two specific changes here:
Net: the behavior you were after — a 503/529 provider getting failed over instead of hard-failing — is live on |
(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.