Repository navigation
Conversation
extra_body is a Python OpenAI SDK convention. The Node SDK has no such option and serializes it as a literal "extra_body" key, which the DeepSeek API ignores, so the reasoningEffort setting never reached the model. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
buildThinkingRequestOptionsreturns{ thinking, extra_body: { reasoning_effort } }, andSessionManagerspreads that into thechat.completions.createparams.extra_bodyis a Python OpenAI SDK option; the Node SDK has no equivalent and serializes it as aliteral
"extra_body"key in the JSON body. The DeepSeek API ignores that key, so thereasoningEffortsetting(
low/high/max) never reaches the model.Evidence
Direct calls to
https://api.deepseek.com/chat/completionswithmodel: deepseek-v4-flashandthinking: {type: "enabled"}:"reasoning_effort": "bogus"(top level)422:reasoning_effort: unknown variant 'bogus', expected one of none, minimal, low, medium, high, xhigh, ultra, max"extra_body": {"reasoning_effort": "bogus"}200(field never read)So the API reads the top-level field and never looks inside
extra_body.Fix
Send
reasoning_effortat the top level, next tothinking(which is already top level). The tests inopenai-thinking.test.tsare updated to the new shape.I could only verify the DeepSeek endpoint. The Volcengine Ark tests use the same payload as before, so please check whether Ark
also expects
reasoning_effortat the top level.Tests
npm testinpackages/core: allopenai-thinkingtests pass. 3 unrelated tests fail with and without this change on my machine(
computeToolCallPermissions allows read tool calls under skill scan paths,ReadImage uses filesystem read permissions ...,UnderstandImage requires network ...).🤖 Generated with Claude Code