Repository navigation
feat(platform): model fallback mechanisms with reusable ModelSelector - #1358
Conversation
Add automatic model fallback when LLM calls fail, with ordered retry based on the agent's supportedModels list (first = primary, rest = fallback chain). - Create reusable ModelSelector component with drag-to-reorder (ReorderList + SearchableSelect), stories, and tests - Replace inline model list in agent instructions page - Add fallbackModels field to SerializableAgentConfig, populated from supportedModels[1..] - Implement generation-level fallback retry loop in runAgentGeneration with transient error detection, circuit breaker recording, deadline budget checks, and failed message cleanup between attempts - Add [MODEL_FALLBACK] system message tag (warning variant) so users see fallback info in chat - Disable fallback in arena mode (explicit model override clears fallbackModels) - Add noFallback option to workflow LLM nodes, upgrade to fallback-aware resolution by default - Upgrade 6 background call sites (summarization, message improvement, translation, cron generation, image analysis) to use resolveLanguageModelWithFallback
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR introduces a model fallback/failover system with UI support. It adds a new Estimated code review effort🎯 4 (Complex) | ⏱️ ~65 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Summary
ModelSelectorcomponent with drag-to-reorder (Framer MotionReorderList+SearchableSelect), Storybook stories, and accessibility-tested unit tests. Replaces the inline model list in the agent instructions page.runAgentGeneration: when a model call fails with a transient error (rate limit, timeout, 5xx), the system automatically tries the next model in the agent's orderedsupportedModelslist. Includes circuit breaker recording, deadline budget checks, failed message cleanup, and[MODEL_FALLBACK]system messages displayed as warnings in chat.fallbackModelsso specific models are tested without failover.noFallbackoption: LLM nodes in automations now use fallback-aware resolution by default, with an opt-outnoFallback: booleanproperty.resolveLanguageModelWithFallbackfor circuit-breaker-aware resolution.Test plan
npm run test:ui)npm test)npm run lint)noFallbackSummary by CodeRabbit