anomalyco / anomalyco/opencode

Ollama reasoning is dropped: responses render empty with gemma4

Open
#46,061 1 comment 0 reactions 1 assignee View on GitHub

@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:

  1. Run gemma4:26b under Ollama 0.33.2 (the OpenAI-compatible /v1 endpoint is on by default)
  2. Point an openai-compatible provider at http://<host>:11434/v1
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.