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
Why does opencode send reasoning_content in OpenAI-compatible messages, and why does it affect model output? #13130
I noticed something confusing when opencode calls an LLM using an OpenAI-compatible chat/completions API: the request messages sometimes include a non-standard field named reasoning_content on an "assistant" message.
According to the OpenAI Chat Completions schema (and also the API docs of the model provider I’m using), reasoning_content is not a documented/standard field for messages[].assistant. However, in my testing, changing the text in reasoning_content clearly changes the model’s final response (e.g., switching the language of the response).
What I observed
opencode sends an assistant message with:
role: "assistant"
content: ""
tool_calls: [...]
reasoning_content: "..." ← undocumented field
If I intercept/modify the outgoing request and change reasoning_content (e.g., replace English with Chinese), the model’s next response language changes accordingly, as if reasoning_content is included in the prompt/context on the server side.
Example (request snippet)
Questions
Why does opencode add reasoning_content to messages?
Is this intentional (e.g., for debugging, tool-call tracing, chain-of-thought logging), or accidental?
What is the expected behavior across providers?
Thanks for the detailed question! This is related to #13002, which discusses similar issues with reasoning fields (reasoning_details) being included in API requests. You may find additional context there about how OpenCode handles reasoning content across different providers.
Activity
github-actions commentedon Feb 11, 2026
Thanks for the detailed question! This is related to #13002, which discusses similar issues with reasoning fields (
reasoning_details) being included in API requests. You may find additional context there about how OpenCode handles reasoning content across different providers.github-actions commentedon Apr 13, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.