fix(agent): comprehensive DeepSeek V4 support — context windows, thinking mode, reasoning replay#15446
Closed
Tranquil-Flow wants to merge 2 commits into
Closed
Conversation
…king mode, reasoning replay Unifies approaches from PRs NousResearch#14952, NousResearch#14958, NousResearch#15325, NousResearch#15228, NousResearch#15354 into a single cohesive implementation: - Add 1M context window entries for V4 models (deepseek-v4-pro, deepseek-v4-flash, deepseek-chat, deepseek-reasoner) - Plumb thinking.type toggle and reasoning_effort mapping for native DeepSeek API (only "high" and "max" are valid) - Strip incompatible sampling params when thinking is enabled - Inject reasoning_content="" on all assistant messages for DeepSeek replay (scoped to api.deepseek.com and OpenRouter) - Fix _extract_reasoning isinstance checks for empty strings - Preserve empty-string reasoning_content in normalize_response - Add _copy_reasoning_content_for_api call in _handle_max_iterations Fixes NousResearch#15353. Supersedes NousResearch#14952, NousResearch#14958, NousResearch#15325, NousResearch#15228, NousResearch#15354.
This was referenced Apr 25, 2026
This was referenced Apr 26, 2026
Contributor
|
Closing as redundant — the DeepSeek
21 regression tests in |
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
Unifies 5 fragmented DeepSeek V4 PRs into a single cohesive implementation:
deepseek-v4-pro,deepseek-v4-flash,deepseek-chat,deepseek-reasoner(128K fallback preserved for older models)thinking.typeandreasoning_effortfor native DeepSeek API — maps effort values to DeepSeek's supported "high"/"max" pair, strips incompatible sampling params (temperature, top_p, etc.) when thinking is enabledreasoning_content=""on all assistant messages for DeepSeek replay, scoped toapi.deepseek.comand OpenRouterdeepseek/prefix. Respectsenabled: falseto skip injection_extract_reasoningguards: Useisinstance(str)checks instead of truthy checks, preventing crashes on non-string reasoning valuesreasoning_contentnormalization: Preserve empty string""innormalize_response(semantically valid for DeepSeek, was being dropped by truthy check)_handle_max_iterations: Add missing_copy_reasoning_content_for_apicall so the max-iterations summary path doesn't produce 400sdeepseek-chatpreserved:deepseek-chat(the non-thinking alias) is NOT forced into thinking mode by default — onlydeepseek-v4-*anddeepseek-reasonermodels, or when the user explicitly opts in viareasoning_configTest plan
deepseek-chatdoes NOT force thinking mode by defaultdeepseek-chatCAN opt-in to thinking with explicit configFixes #15353. Supersedes #14952, #14958, #15325, #15228, #15354.