fix(deepseek): disable thinking mode to fix EMPTY_MESSAGE - #578
Merged
di-sukharev merged 2 commits intoAug 22, 2026
Merged
Conversation
DeepSeek V4 enables thinking mode by default (effort=high). Chain-of-thought is returned in reasoning_content, leaving content empty when max_tokens is low, which causes EMPTY_MESSAGE errors during commit generation. Disable thinking mode via extra_body (required for OpenAI SDK per DeepSeek docs) since commit messages don't need chain-of-thought. Also update MODEL_LIST.deepseek and RECOMMENDED_MODELS to current V4 model names (deepseek-v4-flash / deepseek-v4-pro). Co-authored-by: uni <uni@hanwei.ink>
di-sukharev
requested changes
Aug 20, 2026
extra_body is a Python SDK helper; the OpenAI JavaScript SDK forwards unknown fields as-is, so the API would receive an extra_body field and thinking mode would remain enabled. Pass thinking directly via a local DeepseekChatCompletionParams type extending ChatCompletionCreateParamsNonStreaming. Add request-body regression tests verifying thinking sits at the top level and extra_body is absent. Co-authored-by: uni <uni@hanwei.ink>
di-sukharev
approved these changes
Aug 22, 2026
di-sukharev
left a comment
Owner
There was a problem hiding this comment.
The blocking request-shape issue is fixed. The JavaScript client now sends thinking as a top-level API field, the obsolete extra_body wrapper is explicitly regression-tested, and the current V4 model IDs match DeepSeek's API schema. I also verified the combined merge with the other ready PRs: lint, typecheck, Prettier, build, 158 unit tests, and 34 end-to-end tests all pass. Approved.
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
DeepSeek V4 enables thinking mode by default (effort=high). Chain-of-thought is returned in
reasoning_content, leavingcontentempty whenmax_tokensis low. This causedEMPTY_MESSAGEerrors during commit generation (reported with default 500 token output limit).Changes
src/engine/deepseek.ts: Disable thinking mode viaextra_body: { thinking: { type: 'disabled' } }(required for OpenAI SDK per DeepSeek docs). Commit messages don't need chain-of-thought; this also restorestemperature/top_pbehavior (ignored in thinking mode).src/commands/config.ts: UpdateMODEL_LIST.deepseekandRECOMMENDED_MODELSto current V4 models (deepseek-v4-flash/deepseek-v4-pro).src/utils/errors.ts: Update recommended model in error recovery.Verification
Tested locally: with thinking mode disabled, commit generation succeeds with default 500 token limit (previously required
OCO_TOKENS_MAX_OUTPUT=3000workaround).