feat(playground): auto-send x-no-fallback for provider-specific requests - #1611
Conversation
Automatically include x-no-fallback header when users select a provider-specific model (e.g., openai/gpt-4o). This prevents silent fallback and lets users test the provider they explicitly chose. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
WalkthroughThe pull request introduces provider-specific no-fallback detection logic to chat client components. Both chat-page-client and group-chat-client now determine no-fallback behavior by checking if the selected model contains "/" (provider-specific) OR reading a localStorage override, then propagate this via the x-no-fallback request header. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 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 unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
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 |
There was a problem hiding this comment.
Pull request overview
Adds automatic x-no-fallback request behavior in the Playground UI when a user explicitly selects a provider-scoped model (e.g., openai/...), ensuring requests don’t silently fall back to other providers while preserving the existing localStorage override behavior.
Changes:
- Detect provider-specific model selections via
model.includes("/")and computenoFallbackaccordingly. - Inject
x-no-fallback: trueinto outgoing chat requests in the main chat and comparison panel flows. - Add the same no-fallback behavior to group chat requests (previously missing).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| apps/playground/src/components/playground/group-chat-client.tsx | Adds x-no-fallback header for provider-scoped model selections (or localStorage override) when sending group chat turns. |
| apps/playground/src/components/playground/chat-page-client.tsx | Adds provider-specific detection to the existing header-merging wrapper for both the primary chat and comparison panel requests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Automatically include
x-no-fallbackheader when users select a provider-specific model (e.g.,openai/gpt-4o,anthropic/claude-3-5-sonnet). This prevents silent provider fallback and ensures users test the provider they explicitly chose.Changes
Test plan
pnpm buildand verify no regressions🤖 Generated with Claude Code
Summary by CodeRabbit