anomalyco / anomalyco/opencode
Ollama reasoning is dropped: responses render empty with gemma4
Open
@nexxeln is already working on this.
Since Aug 29, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Using Ollama as an openai-compatible provider, models that emit reasoning (gemma4:26b here) show a thought block in the TUI and then no response text at all.
Ollama puts reasoning on a field called reasoning. The OpenAI Chat protocol in packages/llm/src/protocols/openai-chat.ts only reads reasoning_content, so the reasoning is dropped and the assistant message comes back empty.
A streamed chunk from Ollama looks like this:
{"choices":[{"delta":{"content":"","reasoning":"The user"}}]}
Steps to reproduce:
- Run gemma4:26b under Ollama 0.33.2 (the OpenAI-compatible
/v1endpoint is on by default) - Point an openai-compatible provider at
http://<host>:11434/v1 - Ask anything that makes the model think, the thought appears, the answer doesn't
OpenCode version: dev (also seen on 1.18.20)
Operating System: macOS 26.3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.