You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
reasoning_content is missing when using DeepSeek V4 Flash in thinking #29618
When using OpenCode with OpenRouter and DeepSeek V4 Flash/Pro, the agent fails with: [DeepSeek] The 'reasoning_content' in the thinking mode must be passed back to the API.
Environment
OpenCode: latest
OpenRouter: latest
Model: DeepSeek V4 Flash / DeepSeek V4 Pro
reasoningEffort: xhigh
Thinking mode: enabled
Expected behavior
OpenCode should preserve and pass reasoning_content back to the API when the model requires it.
Actual behavior
The request fails because reasoning_content is missing from the payload.
Notes
This also happens with DeepSeek V4 Pro on OpenRouter, not only Flash.
I confirmed this happens with OpenCode + OpenRouter + DeepSeek V4 Flash/Pro even after updating to the latest version.
Reference
The issue seems related to reasoning field propagation in OpenCode/OpenRouter integrations.
These existing issues cover the same root cause (reasoning_content not preserved/passed back when using DeepSeek thinking mode). Consider adding a "+1" or additional context to one of those instead.
This is specific to OpenRouter in my case: I see OpenCode shows thinking options and returns thinking content to the API for the official DeepSeek provider as well as the DeepSeek model in OpenCode Zen, but not for DeepSeek models via OpenRouter.
No thinking options for DeepSeek V4 Flash via OpenRouter: (Note the OpenRouter icon at the model name)
Show thinking options for DeepSeek V4 Flash via official provider: (Note the DeepSeek icon at the model name)
i found something interesting. The problem is the Provider! After i remove provider (deepseek). Now i can use this model again, but not discounted. sad
Only the official provider deepseek.com requires the strict protocol of reasoning_content. Other 3rd-party providers like GMICloud, Alibaba don't require that.
This works for me! 😊 Note that "npm": "@ai-sdk/openai-compatible" is required!
Checking OpenRouter logs, in the raw JSON request (with "Show request" checked), i can see the field reasoning_content passed back in every turn (not just tool calls).
...
"provider": {
"npm": "@ai-sdk/openai-compatible"
},
"interleaved": {
"field": "reasoning_content"
},
...
This works for me! 😊 Note that "npm": "@ai-sdk/openai-compatible" is required! Checking OpenRouter logs, in the raw JSON request (with "Show request" checked), i can see the field reasoning_content passed back in every turn (not just tool calls).
btw, can we export opencode session as json? including the subagent
Activity
github-actions commentedon May 27, 2026
This issue might be a duplicate of existing issues. Please check:
reasoning_contentin the thinking mode must be passed back to the API. #24920: deepseek V4 flash/pro — same error message about reasoning_content not passed backreasoning_contentin the thinking mode must be passed back to the API. #28974: DeepSeek V4 Pro SiliconFlow — same error: reasoning_content in thinking mode must be passed backThese existing issues cover the same root cause (reasoning_content not preserved/passed back when using DeepSeek thinking mode). Consider adding a "+1" or additional context to one of those instead.
0zKillua commentedon May 28, 2026
panzeyu2013 commentedon May 28, 2026
I think this issue is indeed specific to openrouter. I found similar errors when using New API.
ButlerJoseph commentedon May 28, 2026
As a workaround I set my opencode config to this #25086 (comment)
vinaysb commentedon May 28, 2026
Are you also using the same provider, i.e. siliconflow? I am using the deepseek provider and wonder if its some change on the provider side
bixycler commentedon May 28, 2026
This is specific to OpenRouter in my case: I see OpenCode shows thinking options and returns thinking content to the API for the official DeepSeek provider as well as the DeepSeek model in OpenCode Zen, but not for DeepSeek models via OpenRouter.
No thinking options for DeepSeek V4 Flash via OpenRouter: (Note the OpenRouter icon at the model name)

Show thinking options for DeepSeek V4 Flash via official provider: (Note the DeepSeek icon at the model name)

bixycler commentedon May 28, 2026
This workaround doesn't work for me because i need to use the official provider deepseek.com.
anggaaryas commentedon May 28, 2026
up
anggaaryas commentedon May 28, 2026
i found something interesting. The problem is the Provider! After i remove provider (deepseek). Now i can use this model again, but not discounted. sad
bixycler commentedon May 28, 2026
Only the official provider deepseek.com requires the strict protocol of
reasoning_content. Other 3rd-party providers like GMICloud, Alibaba don't require that.sardukar commentedon May 28, 2026
For now, I'm using the following workaround:
bixycler commentedon May 29, 2026
This works for me! 😊 Note that
"npm": "@ai-sdk/openai-compatible"is required!Checking OpenRouter logs, in the raw JSON request (with "Show request" checked), i can see the field
reasoning_contentpassed back in every turn (not just tool calls).anggaaryas commentedon May 29, 2026
btw, can we export opencode session as json? including the subagent
github-actions commentedon Jul 29, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.