Skip to content

Fix reasoning_effort="none" handling and add gemma to Gemini routing - #3515

Merged
Re-bin merged 2 commits into
HKUDS:mainfrom
masterlyj:fix-branch
Apr 29, 2026
Merged

Re-bin merged 2 commits into
HKUDS:mainfrom
masterlyj:fix-branch

Conversation

@masterlyj

@masterlyj masterlyj commented Apr 28, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Two issues when using reasoning_effort: "none":

  1. API 400 errors on Gemini/gemma models: The value "none" was sent as reasoning_effort to the API, but Gemini/gemma models reject it with "Thinking budget is not supported for this model".

  2. 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.

  3. gemma models not routed to Gemini provider: In auto mode, models like gemma-4-31b-it were 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

File Change
openai_compat_provider.py Don't send reasoning_effort when "none"; treat "none" as disabled in thinking_style, Kimi, and backfill paths (4 fixes)
anthropic_provider.py Don't enable extended thinking when "none"
openai_codex_provider.py Don't send reasoning body when "none"
azure_openai_provider.py Don't suppress temperature or send reasoning body when "none" (2 fixes)
registry.py Add "gemma" to Gemini ProviderSpec keywords

Testing

All existing tests pass (70 passed, 23 skipped — skipped tests are pre-existing async tests requiring pytest-asyncio).

@masterlyj

Copy link
Copy Markdown
Contributor Author

test(providers): cover reasoning_effort="none" and gemma 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

…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

@Re-bin Re-bin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM ;)

@Re-bin
Re-bin merged commit 2b9b41f into HKUDS:main Apr 29, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working valid

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants