Skip to content

feat(playground): auto-send x-no-fallback for provider-specific requests - #1611

Merged
steebchen merged 1 commit into
mainfrom
playground-no-fallback
Feb 8, 2026
Merged

steebchen merged 1 commit into
mainfrom
playground-no-fallback

Conversation

@steebchen

@steebchen steebchen commented Feb 8, 2026 •

Copy link
Copy Markdown
Member

Summary

Automatically include x-no-fallback header 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

  • Updated main chat and comparison panel to detect provider-specific models
  • Added no-fallback support to group chat (previously missing)
  • Preserved localStorage override for power users

Test plan

  • Select "auto" or bare model name → header NOT sent
  • Select provider-specific model (contains "/") → header IS sent
  • Run pnpm build and verify no regressions

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Fallback handling in chat requests now adapts based on the selected model and user configuration.
    • Added fallback control options for both standard and group chat operations.

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>
Copilot AI review requested due to automatic review settings February 8, 2026 02:56
@coderabbitai

coderabbitai Bot commented Feb 8, 2026 •

Copy link
Copy Markdown
Contributor

Walkthrough

The 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

Cohort / File(s) Summary
Chat Client No-Fallback Logic
apps/playground/src/components/playground/chat-page-client.tsx, apps/playground/src/components/playground/group-chat-client.tsx
Added provider-specific no-fallback detection by checking if model name contains "/" and combining with localStorage override (llmgateway_no_fallback) to conditionally set x-no-fallback header in request headers.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • smakosh
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: automatically sending the x-no-fallback header for provider-specific requests, which aligns with the core purpose of the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch playground-no-fallback

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
apps/playground/src/components/playground/chat-page-client.tsx (1)

1209-1213: Consider extracting the duplicated no-fallback computation.

The same 3-line pattern (isProviderSpecific / localStorageOverride / noFallback) is now copy-pasted in ChatPageClient.sendMessageWithHeaders, ExtraChatPanel.sendMessageWithHeaders, and GroupChatClient.continueConversation. A small shared helper (e.g. shouldDisableFallback(model: string): boolean) would keep the logic in one place.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 compute noFallback accordingly.
  • Inject x-no-fallback: true into 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.

@steebchen
steebchen added this pull request to the merge queue Feb 8, 2026
Merged via the queue into main with commit 4c8af17 Feb 8, 2026
14 checks passed
@steebchen
steebchen deleted the playground-no-fallback branch February 8, 2026 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants