fix(llm): stop sending reasoning_effort=minimal as top-level param to providers that reject it#453
Merged
pancacake merged 1 commit intoMay 8, 2026
Conversation
… providers that reject it DeepSeek only accepts high / max / low / medium / xhigh for reasoning_effort, but the code unconditionally forwarded the configured value as a top-level parameter. When LLM_REASONING_EFFORT=minimal (DeepTutor convention for "disable thinking"), DeepSeek rejects the request with: unknown variant minimal, expected one of high, low, medium, max, xhigh Fix across three provider layers: - provider_core: skip top-level reasoning_effort when the provider spec has thinking_style and the semantic effort is "minimal" — the thinking control is already expressed via extra_body - tutorbot: same logic + add deepseek & minimax to the extra_body chain (they were missing, so thinking disable was silently ignored) - cloud_provider: skip reasoning_effort=minimal for providers that handle thinking through extra_body Other providers (OpenAI, Anthropic, Gemini, Mistral, etc.) are unaffected because they either don't have thinking_style or accept minimal natively.
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.
Summary
reasoning_effort=minimal— it only acceptshigh/max/low/medium/xhighLLM_REASONING_EFFORT=minimalto disable thinking, the code was sending it as a top-level parameter to DeepSeek, causing API errorsextra_body(DeepSeek, DashScope, VolcEngine, BytePlus, MiniMax), skip the top-levelreasoning_effortwhen the intent is to disable thinking — theextra_bodyalready carries thethinking.type=disabledsignalChanges
provider_core/openai_compat_provider.pyreasoning_effortwhenthinking_styleis set and semantic effort isminimaltutorbot/providers/openai_compat_provider.pyextra_bodychaincloud_provider.pyreasoning_effort=minimalfor providers that useextra_bodythinking controlAffected providers
Only 7 providers with
thinking_styleare affected. OpenAI, Anthropic, Gemini, Mistral, and all others are untouched.Related
44686ab: documentedminimalas a valid value for DeepSeek (but it was broken)🤖 Generated with Claude Code