Skip to content

fix(llm): stop sending reasoning_effort=minimal as top-level param to providers that reject it#453

Merged
pancacake merged 1 commit into
HKUDS:devfrom
Starfie1d1272:fix/deepseek-reasoning-effort-minimal
May 8, 2026
Merged

fix(llm): stop sending reasoning_effort=minimal as top-level param to providers that reject it#453
pancacake merged 1 commit into
HKUDS:devfrom
Starfie1d1272:fix/deepseek-reasoning-effort-minimal

Conversation

@Starfie1d1272

Copy link
Copy Markdown
Contributor

Summary

  • DeepSeek rejects reasoning_effort=minimal — it only accepts high/max/low/medium/xhigh
  • When user sets LLM_REASONING_EFFORT=minimal to disable thinking, the code was sending it as a top-level parameter to DeepSeek, causing API errors
  • Fix: for providers that handle thinking via extra_body (DeepSeek, DashScope, VolcEngine, BytePlus, MiniMax), skip the top-level reasoning_effort when the intent is to disable thinking — the extra_body already carries the thinking.type=disabled signal

Changes

File Change
provider_core/openai_compat_provider.py Skip top-level reasoning_effort when thinking_style is set and semantic effort is minimal
tutorbot/providers/openai_compat_provider.py Same logic + add deepseek & minimax to extra_body chain
cloud_provider.py Skip reasoning_effort=minimal for providers that use extra_body thinking control

Affected providers

Only 7 providers with thinking_style are affected. OpenAI, Anthropic, Gemini, Mistral, and all others are untouched.

Related

🤖 Generated with Claude Code

… 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.
@pancacake pancacake changed the base branch from main to dev May 8, 2026 17:52
@pancacake pancacake merged commit 7b73769 into HKUDS:dev May 8, 2026
7 checks passed
@Starfie1d1272 Starfie1d1272 deleted the fix/deepseek-reasoning-effort-minimal branch May 8, 2026 20:24
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