Files
openclaw/src
zerone0x 9b7fce0249 fix(auth): reset error counters when cooldown expires to prevent infinite escalation
When multiple models from the same provider share a single auth profile
(e.g. zai:default), rate limit errors from model fallback probes
accumulate the error count within the active cooldown window. After the
cooldown expires, clearExpiredCooldowns() resets the count in-memory,
but the on-disk state may still carry the stale count when the
lock-based updater reads a fresh store. The next failure then computes
backoff from the inflated count (e.g. errorCount=3 → 25 min instead of
1 min), creating an ever-escalating cooldown loop.

Fix: in computeNextProfileUsageStats, check whether the previous
cooldown/disabled window has expired before computing the next backoff.
If it has, reset error counters (mirroring what clearExpiredCooldowns
does) so the profile gets a fresh 1-minute window.

Fixes #40989

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 23:22:19 +03:00
..