openclaw - 💡(How to fix) Fix Model fallback: optionally surface compact user-visible fallback notice [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#56852Fetched 2026-04-08 01:46:55
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

Root Cause

  • Makes model-routing behavior transparent
  • Helps users understand sudden quality / style / latency shifts
  • Makes quota and auth failures visible earlier
  • Reduces confusion when the configured primary is not actually what answered

Code Example

Opus failed (rate limit), using GPT-5.4 as fallback.
RAW_BUFFERClick to expand / collapse

Problem

When OpenClaw silently falls back from one model to another, the user usually has no visibility that it happened.

This makes debugging harder, hides quota/auth/provider issues, and can create confusing cost/latency behavior.

Real example

Observed in production:

  • main configured as claude-opus-4-6 -> gpt-5.4
  • Opus hit repeated 429 rate_limit_error
  • OpenClaw fell back to GPT-5.4 successfully
  • user only saw a normal response unless logs were inspected manually

Earlier, the reverse happened:

  • GPT-5.4 failed with OAuth refresh failure
  • OpenClaw fell back to Opus
  • again, the user did not get a clear runtime signal that fallback had occurred

Requested behavior

When a fallback model is used, optionally surface a concise user-visible note.

Example:

Opus failed (rate limit), using GPT-5.4 as fallback.

This should be short, human-readable, and ideally attached to the assistant response rather than requiring log inspection.

Why this matters

  • Makes model-routing behavior transparent
  • Helps users understand sudden quality / style / latency shifts
  • Makes quota and auth failures visible earlier
  • Reduces confusion when the configured primary is not actually what answered

Suggested design

Support something like:

  • off by default, or configurable by agent/session/channel
  • only surface for meaningful fallback reasons (auth failure, rate limit, outage, timeout)
  • concise reason categories, not raw provider stack traces

For example:

  • rate limit
  • auth failed
  • network timeout
  • provider unavailable

Nice-to-have

  • Include the actual responding model in metadata / status output
  • Expose a hook or structured event so channels/UIs can render fallback notices cleanly
  • Allow session-level policy: silent / compact notice / verbose notice

extent analysis

Fix Plan

To address the issue, we will implement a fallback notification system. Here are the steps:

  • Introduce a new configuration option to enable/disable fallback notifications
  • Modify the OpenClaw fallback logic to trigger a notification when a fallback occurs
  • Create a notification system that can surface concise user-visible notes

Example Code

# Configure fallback notification
class OpenClawConfig:
    def __init__(self, fallback_notification_enabled=False):
        self.fallback_notification_enabled = fallback_notification_enabled

# Modify fallback logic to trigger notification
class OpenClaw:
    def __init__(self, config):
        self.config = config

    def fallback(self, reason, primary_model, fallback_model):
        if self.config.fallback_notification_enabled:
            self.trigger_notification(reason, primary_model, fallback_model)

    def trigger_notification(self, reason, primary_model, fallback_model):
        notification = f"{primary_model} failed ({reason}), using {fallback_model} as fallback."
        # Surface the notification to the user

# Create a notification system
class NotificationSystem:
    def __init__(self):
        self.notifications = []

    def add_notification(self, notification):
        self.notifications.append(notification)

    def get_notifications(self):
        return self.notifications

Verification

To verify that the fix worked, test the following scenarios:

  • Enable fallback notifications and trigger a fallback due to rate limit error
  • Verify that a concise user-visible note is surfaced to the user
  • Disable fallback notifications and trigger a fallback due to auth failure
  • Verify that no notification is surfaced to the user

Extra Tips

  • Consider implementing a hook or structured event to allow channels/UIs to render fallback notices cleanly
  • Use a session-level policy to control the verbosity of fallback notifications
  • Include the actual responding model in metadata/status output for transparency.

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