Files
OmniRoute/tests
Xiangzhe 7986526782 fix(resilience): don't clear an active rate-limit cooldown for non-quota_exhausted errors (#11277)
maybeClearRecoveredQuotaState() only guarded against clearing a still-future
rateLimitedUntil inside the lastErrorType === "quota_exhausted" branch. Any
other lastErrorType (rate_limited, free_quota_exhausted, etc.) skipped
straight to clearRecoveredProviderState() with no future-cooldown check at
all, so a multi-day cooldown got wiped on the next quota sync a few minutes
later — a self-restart loop burning real upstream calls against a
known-exhausted connection.

Added a universal fallback guard for every other lastErrorType: a future
rateLimitedUntil is a hard statement from whatever handler persisted it, and
no quota poll finding some usable window elsewhere may overrule it.

Also fixed a pre-existing test that encoded the same defect class with a
shorter window (asserted a still-future cooldown got cleared by a successful
refresh) and added a regression test pinning the new guard.
2026-08-23 22:38:22 -03:00
..