openclaw - 💡(How to fix) Fix Bug: Silent failure and fallback override when OpenAI usage limit (429) is hit [3 comments, 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#59064Fetched 2026-04-08 02:29:13
View on GitHub
Comments
3
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
commented ×3

Error Message

When the OpenAI usage limit or rate limit (HTTP 429) is reached, OpenClaw detects the error but fails to proactively notify the user via configured channels (e.g., Slack). Furthermore, although the system correctly selects the fallback model (e.g., google/gemini-3.1-pro-preview), a live session model state overwrite occurs right before the execution attempt, forcing the model back to the rate-limited openai-codex/gpt-5.4. 4. Observe that no error notification is sent to the user's client (e.g., Slack).

  • A clear error message or notification should be routed to the user's active channel (e.g., Slack) indicating the model limit was reached.
RAW_BUFFERClick to expand / collapse

Describe the bug When the OpenAI usage limit or rate limit (HTTP 429) is reached, OpenClaw detects the error but fails to proactively notify the user via configured channels (e.g., Slack). Furthermore, although the system correctly selects the fallback model (e.g., google/gemini-3.1-pro-preview), a live session model state overwrite occurs right before the execution attempt, forcing the model back to the rate-limited openai-codex/gpt-5.4.

To Reproduce

  1. Configure agents.defaults.model.primary to openai-codex/gpt-5.4.
  2. Configure agents.defaults.model.fallbacks to ['google/gemini-3.1-pro-preview'].
  3. Trigger an OpenAI usage limit or HTTP 429 response.
  4. Observe that no error notification is sent to the user's client (e.g., Slack).
  5. Observe in the runtime logs that a fallback_model decision is made to Gemini, but immediately followed by a log indicating live session model switch detected before attempt ... google/gemini-3.1-pro-preview -> openai-codex/gpt-5.4, causing the fallback to fail.

Expected behavior

  • A clear error message or notification should be routed to the user's active channel (e.g., Slack) indicating the model limit was reached.
  • The fallback model should execute successfully without being overridden by the live session model state at the last moment.

Environment:

  • Deployment: macOS arm64 (Mac mini)
  • OpenClaw Version: 2026.3.23-2
  • Primary Model: openai-codex/gpt-5.4
  • Fallback Model: google/gemini-3.1-pro-preview

extent analysis

TL;DR

Implement a mechanism to prevent live session model state overwrites when a fallback model is selected due to rate limiting or usage limits.

Guidance

  • Review the logic for handling rate limit errors (HTTP 429) to ensure that notifications are properly sent to configured channels like Slack.
  • Investigate the model selection process to identify why the live session model state is overwriting the fallback model choice (google/gemini-3.1-pro-preview) with the primary model (openai-codex/gpt-5.4).
  • Consider adding a lock or a more robust state management system to prevent the live session model from overwriting the fallback model during execution attempts.
  • Verify that the fallback model configuration is correctly applied and that the system can successfully execute the fallback model without interruptions from the live session model state.

Example

No specific code example can be provided without more details on the implementation, but ensuring that the fallback model is not overwritten by the live session state could involve adding checks or locks in the model selection logic.

Notes

The exact solution may depend on the internal workings of OpenClaw and how it manages model states and notifications. Understanding the flow of model selection and error handling will be crucial to resolving this issue.

Recommendation

Apply a workaround to prevent the live session model state from overwriting the fallback model choice, as this seems to be the primary cause of the failure to execute the fallback model successfully. This could involve temporary modifications to the model selection logic or the addition of a mechanism to lock the model choice once a fallback is triggered.

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