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 field from Ollama's OpenAI-compatible endpoint is not rendered as a separate thinking block for gpt-oss:20b #45547
When using OpenCode with a custom @ai-sdk/openai-compatible provider pointing to a local Ollama server, the reasoning field returned by gpt-oss:20b is not rendered in the collapsible "thinking" UI block. Instead, the reasoning text appears mixed inline with the final response text in the chat.
This is not a case of the upstream provider failing to separate the fields — Ollama returns content and reasoning cleanly separated (see proof below). The issue appears to be on OpenCode's side, in how it consumes/renders the reasoning field for this provider setup.
Proof that Ollama returns content/reasoning correctly separated (direct curl against Ollama, bypassing OpenCode entirely):
bash
curl -s http://localhost:11434/v1/chat/completions
-H "Content-Type: application/json"
-d '{"model":"gpt-oss:20b","messages":[{"role":"user","content":"tell me a joke"}]}' | jq
json
{
"choices": [{
"message": {
"role": "assistant",
"content": "Why did the book go to the hospital?\n\nBecause it had an upset stomach. 📚🤒",
"reasoning": "User wants a joke. I should give a short, funny joke. ..."
},
"finish_reason": "stop"
}]
}
Both content and reasoning are present and cleanly separated at the Ollama level. OpenCode should render reasoning in the collapsible thinking UI, but instead it ends up mixed into the visible response text (see screenshot).
Plugins
none
OpenCode version
1.18.23
Steps to reproduce
1.Configure the provider as shown above (Ollama's OpenAI-compatible endpoint via @ai-sdk/openai-compatible).
2.Select gpt-oss:20b as the model.
3.Send any prompt (e.g. "tell me a joke").
3.Observe: the reasoning text appears prepended/mixed into the response, not in a separate collapsible block.
Activity
github-actions commentedon Aug 27, 2026
This issue might be a duplicate of existing issues. Please check:
reasoningfield is dropped #35283: OpenAI-compatible reasoning streamed under thereasoningfield is dropped — same core symptom with OpenAI-compatible providerscontentfield and pushed word-by-word, causingThoughtblock spam in TUI #40865: Reasoning content mixed intocontentfield causingThoughtblock spam in TUI — same rendering symptom you describereasoningfield via Ollama/Qwen3 — same provider stack<think>tags leaks into text content — related provider-side rendering issueIf your issue is distinct from all of the above, please add a note explaining how it differs so maintainers can triage it separately.
reasoningfield is dropped #35283