Repository navigation
Fix reasoning_effort="none" handling and add gemma to Gemini routing - #3515
Merged
Merged
Conversation
chengyongru
approved these changes
Apr 29, 2026
This was referenced Apr 29, 2026
Contributor
Author
|
test(providers): cover reasoning_effort="none" and gemma auto-routing
|
…ma to Gemini provider - Do not send reasoning_effort="none" to APIs (prevents 400 on gemma/Gemini) - Treat "none" as thinking disabled in thinking_style, Kimi, and reasoning_content backfill paths - Fix Anthropic extended thinking not respecting "none" - Fix Azure OpenAI temperature suppression and reasoning body for "none" - Fix Codex reasoning body for "none" - Add "gemma" keyword to Gemini ProviderSpec for correct auto routing
- Anthropic: "none" must not enable extended thinking - Azure: "none" must not suppress temperature or inject reasoning body - DeepSeek/DashScope/Kimi: "none" sends thinking disabled, skips reasoning_effort field - Gemini: gemma keyword enables auto-routing for gemma models
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
Two issues when using
reasoning_effort: "none":API 400 errors on Gemini/gemma models: The value
"none"was sent asreasoning_effortto the API, but Gemini/gemma models reject it with "Thinking budget is not supported for this model".Inconsistent "none" handling across providers: Some code paths treated
"none"as enabling thinking mode, while others (4 existing checks at L461, L507, L646, L737) already treated it as disabled.gemma models not routed to Gemini provider: In auto mode, models like
gemma-4-31b-itwere not matched to the Gemini provider because the keyword"gemma"was missing from the ProviderSpec.Solution
Unify
reasoning_effort="none"to mean "thinking disabled" across all providers, consistent with the 4 existing checks already in the codebase.Add
"gemma"to the Gemini provider keywords.Changes
openai_compat_provider.pyreasoning_effortwhen"none"; treat"none"as disabled in thinking_style, Kimi, and backfill paths (4 fixes)anthropic_provider.py"none"openai_codex_provider.py"none"azure_openai_provider.py"none"(2 fixes)registry.py"gemma"to Gemini ProviderSpec keywordsTesting
All existing tests pass (70 passed, 23 skipped — skipped tests are pre-existing async tests requiring pytest-asyncio).