Repository navigation
fix(accounts): carry failure kind on rotation — transient cools down, terminal evicts - #11008
Merged
diegosouzapw merged 1 commit intoAug 21, 2026
Conversation
maxmad64bis
force-pushed
the
fix/account-rotation-eviction
branch
from
August 21, 2026 14:55
854a916 to
7c6308e
Compare
diegosouzapw
merged commit Aug 21, 2026
bc0a272
into
cheaper-inference:release/v3.8.50
7 of 16 checks passed
Sa3id23
pushed a commit
to Sa3id23/OmniRoute
that referenced
this pull request
Aug 21, 2026
… terminal evicts (cheaper-inference#11008) ⭐5 — Rotação de conta não distinguia falha transitória (quota) de terminal (credencial morta) — ambas só esfriavam e eram retentadas para sempre. Agora markCooldown aceita kind transient/terminal; 3 terminais consecutivos evictam a conta (com fallback para não travar se todas evictadas). TDD, 17/17 testes, lint/typecheck/cycles OK.
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
… terminal evicts (cheaper-inference#11008) ⭐5 — Rotação de conta não distinguia falha transitória (quota) de terminal (credencial morta) — ambas só esfriavam e eram retentadas para sempre. Agora markCooldown aceita kind transient/terminal; 3 terminais consecutivos evictam a conta (com fallback para não travar se todas evictadas). TDD, 17/17 testes, lint/typecheck/cycles OK.
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.
Summary
When a multi-account provider fails, OmniRoute backs off one account and picks another. Right now a temporary quota on one account and a dead credential look the same — both just cool down and get retried forever. This PR teaches the rotation to tell them apart: temporary failures only cool down, repeated permanent failures retire that account from rotation until a success clears it.
No new table or setting — just an in-memory flag reset on success or on the next account sync. Single-account providers are unchanged.
Related Issues
Related to #11006
Changes
open-sse/executors/accountRotation.ts—markCooldownnow takes kindtransient(quota, network) vsterminal(permanent), defaulting to transient so every existing caller stays valid; after 3 consecutive terminals the account is evicted and skipped bypickAccountunless every account is evicted (always returns an account rather than hanging);markSuccessclears the evictionopen-sse/executors/opencode.ts— wrapper forwards the kind (no caller passes terminal yet — that mapping belongs to a follow-up, see Reviewer Notes)tests/unit/account-rotation-lot-c.test.ts— 5 tests: transient never evicts, terminal evicts at 3 and is skipped, all-evicted fallback still returns an account, success clearsTesting
node --import tsx/esm --test tests/unit/account-rotation*.test.ts— 17/17npm run lint/typecheck:core/check:cycles— 0 / 0 / OKChecklist
c130f2aa1)release/v3.8.50turns green)Reviewer Notes
3is just a testable bound, not a rule — adjust it in review.