mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-15 11:43:10 +03:00
Adversarial review of the #10334 Task 2 connection-scope branch found the "never terminal" invariant relied only on ruleScope === "connection", which is not structurally guaranteed against a future agentrouter rule pairing that scope with a permanent/credits-exhausted reason. Extract the guard into an exported, independently-testable predicate (isAgentrouterConnectionQuotaScope) that also requires reason === QUOTA_EXHAUSTED and !permanent/!creditsExhausted. Also: document the disableCooling(#2997) interaction and the providerErrorRules.ts 6h-vs-30min-cap discrepancy the review flagged, and add position-guard + exclusivity-positive tests so a future refactor that reorders the branch or stops locking non-agentrouter providers cannot pass silently.