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
The problem with deepseek-reasoner in OpenCode #8934
Missing reasoning_content field in the assistant message at message index 32.
For more information, please refer to https://api-docs.deepseek.com/guides/thinking_mode#tool-calls
This happened while the custom subagent was doing tool-using work.
Activity
github-actions commentedon Jan 16, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if your specific case is not addressed by these issues.
Robinblennert commentedon Jan 20, 2026
Have you fixed it yet?
I used 128k really quick and couldnt save the work. Crazy NO idea how much of tokens was used but I understand there is a bug.
tongsh6 commentedon Mar 10, 2026
I can reproduce a very similar issue with a custom subagent using
deepseek/deepseek-reasonerin OpenCode.Setup
Custom local subagent:
~/.config/opencode/agents/architect.mdThis is not an oh-my-opencode built-in agent. It is a local custom OpenCode subagent.
Observed error
When this subagent performs tool-using work, OpenCode fails with:
Why this seems like an OpenCode compatibility issue
According to DeepSeek's official docs for thinking mode + tool calls:
contentreasoning_contenttool_callsDocs:
https://api-docs.deepseek.com/guides/thinking_mode#tool-calls
This suggests OpenCode is likely dropping
reasoning_contentwhen replaying assistant/tool history for reasoning models during tool-call continuation.Related notes
anomalyco/opencode#9397, which looks closely relatedHelpful distinction
This may be reproducible specifically with:
deepseek/deepseek-reasonerbash: truewas enough in my case)Temporary workaround on my side is to switch this subagent to
deepseek/deepseek-chator a non-DeepSeek reasoning model.If useful, I can provide a more minimal repro prompt next.
tongsh6 commentedon Mar 10, 2026
Follow-up: my previous comment lost the fenced blocks due to shell quoting. Here is the exact missing content.
Local subagent config
Exact error text
This happened while the custom subagent was doing tool-using work.
tongsh6 commentedon Mar 10, 2026
Solution:
Configure the DeepSeek model with:
{ "provider": { "deepseek": { "npm": "@ai-sdk/openai-compatible", "name": "DeepSeek", "options": { "baseURL": "https://api.deepseek.com/v1", "apiKey": "{env:DEEPSEEK_API_KEY}" }, "models": { "deepseek-reasoner": { "name": "DeepSeek Reasoner", "interleaved": { "field": "reasoning_content" } } } } } }The key part is:
After adding this and restarting OpenCode, the issue was resolved.
github-actions commentedon Jul 6, 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.