fix: silent model failover with fallback notification#13658
Open
taw0002 wants to merge 1 commit intoopenclaw:mainfrom
Open
fix: silent model failover with fallback notification#13658taw0002 wants to merge 1 commit intoopenclaw:mainfrom
taw0002 wants to merge 1 commit intoopenclaw:mainfrom
Conversation
When model failover occurs and the fallback model succeeds, the user no longer sees the raw billing/rate-limit error spam. Instead, a brief '🔄 Fell back to <model> (primary model unavailable)' note is prepended to the response. When ALL configured models fail: - Billing errors: cleaner message directing to billing dashboards - Rate limit errors: cleaner message asking to wait and retry - Other errors: unchanged (shows trimmed error + logs hint) Changes: - agent-runner.ts: Detect provider mismatch after successful fallback, prepend subtle fallback notification - agent-runner-execution.ts: Classify billing/rate-limit errors in the catch-all block for cleaner user-facing messages when all models fail
bfc1ccb to
f92900f
Compare
|
This pull request has been automatically marked as stale due to inactivity. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When model failover occurs (e.g., Anthropic billing/rate limit → OpenAI fallback), the user sees the raw billing error message as a standalone reply — even when the fallback model succeeds and completes the request normally. This creates a confusing UX where users get scary billing warnings followed by a normal response.
Example of current behavior:
...immediately followed by a normal response from the fallback model.
Solution
1. Subtle fallback notification on success
When the primary model fails and a fallback model succeeds, prepend a brief note instead of showing the raw error:
This tells the user what happened without being alarming. The actual response follows normally.
2. Cleaner error messages when ALL models fail
When every configured model fails, the error messages are now classified:
⚠️ All configured models failed due to billing limits. Check your provider billing dashboards and top up credits.⚠️ All configured models are currently rate-limited. Please wait a moment and try again.⚠️ Agent failed before reply: <message>)Changes
src/auto-reply/reply/agent-runner.ts: Detect provider mismatch after successful fallback, prepend subtle fallback notificationsrc/auto-reply/reply/agent-runner-execution.ts: Classify billing/rate-limit errors in the catch-all block for cleaner user-facing messagesTesting
pnpm check)Greptile Overview
Greptile Summary
This PR improves UX for model failover scenarios by adding subtle success notifications and clearer error messages.
Changes:
🔄 Fell back to <provider>/<model>note instead of scary billing warningsKey improvements:
Confidence Score: 5/5
(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!