Skip to content

Comments

Skip cooldowned providers during model failover#2143

Merged
gumadeiras merged 2 commits intoopenclaw:mainfrom
YiWang24:fix/failover-cooldown-skip
Jan 27, 2026
Merged

Skip cooldowned providers during model failover#2143
gumadeiras merged 2 commits intoopenclaw:mainfrom
YiWang24:fix/failover-cooldown-skip

Conversation

@YiWang24
Copy link
Contributor

Based on issue #2142. This PR improves the model failover experience by skipping providers where all auth profiles are currently in cooldown. This avoids the cumulative delay when multiple OAuth-based providers (like google-gemini-cli or google-antigravity) fail or expire simultaneously.

Changes:

  • In runWithModelFallback, we now check the auth store to see if any profiles for the candidate provider are available (not in cooldown).
  • If no profiles are available, the provider is skipped immediately, allowing the system to fall through to stable API key-based providers (like zai) without artificial delays.

When all auth profiles for a provider are in cooldown, the failover
mechanism now skips that provider immediately rather than attempting
and waiting for the cooldown error. This prevents long delays when
multiple OAuth providers fail in sequence.
@sebslight sebslight added gateway Gateway runtime and removed gateway Gateway runtime labels Jan 26, 2026
@gumadeiras gumadeiras self-requested a review January 27, 2026 02:09
@gumadeiras gumadeiras merged commit ff42a48 into openclaw:main Jan 27, 2026
23 of 25 checks passed
@YiWang24 YiWang24 deleted the fix/failover-cooldown-skip branch January 27, 2026 03:04
gumadeiras added a commit that referenced this pull request Jan 27, 2026
* Agents: skip cooldowned providers in fallback

* fix: skip cooldowned providers during model failover (#2143) (thanks @YiWang24)
@gumadeiras
Copy link
Member

Landed via squash on main.

  • Gate: pnpm lint && pnpm build && pnpm test
  • Merge commit: ff42a48

Follow-up: #2534 adds per-agent auth store checks, rate_limit reason, call-site agentDir, tests, and changelog.

Thanks @YiWang24!