fix(deepseek): send explicit thinking:disabled when reasoning is off#21668
Closed
wjameswen888 wants to merge 1 commit into
Closed
fix(deepseek): send explicit thinking:disabled when reasoning is off#21668wjameswen888 wants to merge 1 commit into
wjameswen888 wants to merge 1 commit into
Conversation
DeepSeek direct API requires an explicit thinking.type parameter.
When thinking is disabled (reasoning_effort=none or enabled=false),
the API defaults to thinking=enabled — generating reasoning_content
that gets stripped/not passed back, causing HTTP 400 on subsequent
turns.
This mirrors the existing Kimi extra_body.thinking pattern:
- Detect DeepSeek provider/model/base_url in run_agent.py
- Send {"thinking": {"type": "disabled"}} when appropriate
- Respect reasoning_config.effort=none as disabled
Fixes: NousResearch#15700, NousResearch#17212
Related: NousResearch#15213
Collaborator
Contributor
|
This looks implemented on current main, so this duplicate PR can be closed by the automated hermes-sweeper review. Evidence:
Thanks for the report and patch — the fix is now present on main in the provider-profile implementation. |
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
When using DeepSeek direct API (
api.deepseek.com) withreasoning_effort: none, Hermes fails with HTTP 400:Root cause: The DeepSeek API requires an explicit
thinking: {"type": "disabled"}parameter when thinking is off. Without it, the API defaults to thinking=enabled — generatingreasoning_contentthat gets stripped by the compression pipeline, then rejected on the next turn.This is the same pattern already handled for Kimi, but missing for DeepSeek.
Fix
Mirrors the existing Kimi
extra_body.thinkingblock:run_agent.py: Detect DeepSeek provider/model/base_url (_is_deepseek), pass to transportagent/transports/chat_completions.py: Send{"thinking": {"type": "disabled"}}to DeepSeek API whenreasoning_config.enabled=falseoreffort=noneVerification
reasoning_effort: none)Related Issues
Fixes #15700 — "DeepSeek API: Missing thinking:disabled parameter causes 400"
Fixes #17212 — "DeepSeek direct API 400 reasoning_content must be passed back"
Related #15213 — "HTTP 400 reasoning_content in cron/auxiliary path"