fix(platform): surface actionable error when whole fallback chain is unconfigured (#1455)#1940
fix(platform): surface actionable error when whole fallback chain is unconfigured (#1455)#1940larryro wants to merge 1 commit into
Conversation
|
Warning Review limit reached
More reviews will be available in 2 minutes and 8 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses rolling per-developer review limits. Reviews become available again as older review attempts age out of the rolling limit window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Desk Review — #1455 fallback chain unconfigured-error fixVerdict: READY TO MERGE. CIAll required checks green ( Tests (run locally on this branch)
What the change doesWhen the whole fallback chain is exhausted with no model ever reaching a live provider call ( Verified correct
Non-blocking notes (optional)
These do not affect merge-readiness. READY TO MERGE. |
Summary
Fixes #1455.
When the agent fallback model chain (e.g.
gemini → gemini-flash → mistral-large → … → qwen-next) is exhausted because every model fails to resolve for a configuration reason — most commonly no API key is configured on any provider — the loop previously threw the last entry's per-modelMissingApiKeyError. The user saw a confusing message implicating only the tail model (qwen-next) after "multiple retries", with no hint that the real problem is that no provider is configured.This matches the issue's expected behaviour: "the system should stop early with a meaningful configuration error."
What changed
providers/errors.tsbuildChainExhaustionError(...): when no model ever reached a live provider call (attemptedCount === 0) and every failure was a config/resolution error, it collapses the chain into a single actionableNoProviderAvailableError(whichclassifyChatErrorCodemaps tomissing_api_key→ the localized "Open Settings → AI providers" hint). An already-terminalNoProviderAvailableErroris passed through untouched; a chain where a real attempt happened still surfaces the genuine runtime error.FRIENDLY_NO_PROVIDERcopy here so the provider loader and the fallback chain share one source of truth (no string drift).providers/file_actions.ts— importsFRIENDLY_NO_PROVIDERinstead of redefining it.lib/agent_chat/internal_actions.ts— the fallback loop now records each resolution (config) failure and routes the chain-exhausted throw throughbuildChainExhaustionError.No new user-visible strings (the friendly copy already existed and is rendered via the existing
missing_api_keychat-error code), so no i18n/docs changes are required.Tests
providers/errors.test.tsforbuildChainExhaustionError(all-unconfigured collapse, runtime-error passthrough, terminal passthrough, fallbacks).errors.test.ts: 51 passed.oxlint --type-awareclean on all changed files.