openclaw - 💡(How to fix) Fix [Bug]: Subscription quota limit ("You've hit your limit") classified as billing error, blocks model fallback [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#59784Fetched 2026-04-08 02:40:33
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

Error Message

When using a Claude subscription (setup-token / Claude Code OAuth) and the usage quota is exhausted, OpenClaw receives an error like: Claude Code returned an error result: You've hit your limit · resets 6pm (UTC) This error is classified as a billing failure, which puts the auth profile into a long disabledUntil state. Because billing-disabled profiles use a long backoff (not FailoverError), the configured fallback models are never attempted — the agent simply fails until the window resets.

  1. Subscription quota is exhausted → error classified as billing
  2. Config escape hatch (nice-to-have): allow users to define custom error text patterns that should be treated as failover-worthy:

Root Cause

This error is classified as a billing failure, which puts the auth profile into a long disabledUntil state. Because billing-disabled profiles use a long backoff (not FailoverError), the configured fallback models are never attempted — the agent simply fails until the window resets.

Code Example

Claude Code returned an error result: You've hit your limit · resets 6pm (UTC)

---

auth:
  failoverPatterns:
    - "You've hit your limit"
    - "resets at"
RAW_BUFFERClick to expand / collapse

Problem

When using a Claude subscription (setup-token / Claude Code OAuth) and the usage quota is exhausted, OpenClaw receives an error like:

Claude Code returned an error result: You've hit your limit · resets 6pm (UTC)

This error is classified as a billing failure, which puts the auth profile into a long disabledUntil state. Because billing-disabled profiles use a long backoff (not FailoverError), the configured fallback models are never attempted — the agent simply fails until the window resets.

Expected Behavior

A subscription usage quota reset ("resets at 6pm UTC") is a temporary, time-bounded limit — not a billing/credit problem. It should be classified as quota or rate_limit, which triggers FailoverError and automatically switches to the next model in agents.defaults.model.fallbacks.

Actual Behavior

  1. Subscription quota is exhausted → error classified as billing
  2. Auth profile enters long disabledUntil state
  3. Fallback models (e.g. minimax-portal/MiniMax-M2.7-highspeed) are never tried
  4. Agent fails for the remainder of the quota window

Suggested Fix

Two complementary changes:

  1. In classifyFailoverReason: detect the "You've hit your limit" / "resets at" pattern and classify it as quota (triggering failover) rather than billing (triggering long disable).

  2. Config escape hatch (nice-to-have): allow users to define custom error text patterns that should be treated as failover-worthy:

auth:
  failoverPatterns:
    - "You've hit your limit"
    - "resets at"

Environment

  • OpenClaw version: 2026.3.8
  • Auth method: Claude subscription (setup-token)
  • Fallback configured: yes (minimax)

Related

  • #1522 — fallback not triggered when all profiles in cooldown (fixed)
  • #11972 — fallback not triggered on 429 (closed)
  • #22136 — fallback not triggered on rate-limit cooldown (closed)

extent analysis

TL;DR

Update the classifyFailoverReason function to correctly classify quota exhaustion errors as quota instead of billing to trigger failover to fallback models.

Guidance

  • Review the classifyFailoverReason function to detect the specific error message pattern "You've hit your limit" or "resets at" and classify it as a quota error.
  • Consider adding a config option failoverPatterns to allow users to define custom error text patterns that should trigger failover.
  • Verify that the fallback models are correctly configured and prioritized in agents.defaults.model.fallbacks.
  • Test the updated classification and failover behavior with a simulated quota exhaustion error.

Example

auth:
  failoverPatterns:
    - "You've hit your limit"
    - "resets at"

This example shows how the failoverPatterns config option could be used to define custom error patterns.

Notes

The suggested fix assumes that the classifyFailoverReason function is the primary cause of the issue. Additional logging or debugging may be necessary to confirm this.

Recommendation

Apply the workaround by updating the classifyFailoverReason function to correctly classify quota exhaustion errors, as this will allow the fallback models to be attempted when the primary model is rate-limited.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: Subscription quota limit ("You've hit your limit") classified as billing error, blocks model fallback [1 participants]