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
Ollama integration: API returns HTTP 200 but responses not displayed #4488
First request succeeds (16s, HTTP 200), second fails after user interruption.
Verified Working
✅ All Ollama API endpoints respond correctly (tested via Postman)
✅ Both /v1/chat/completions (OpenAI-compatible) and /api/chat (native)
✅ Streaming and non-streaming modes
✅ Models generate text properly via native Ollama CLI
Analysis
The issue appears to be in OpenCode's response parsing/display logic, not the Ollama API itself. Ollama successfully processes requests, but OpenCode fails to handle the responses.
Actually, I take that back. I can chat, but doing anything that involves tools (like /init) seems to fail with gpt-oss:20b, while qwen3-coder:30b doesn't even respond with anything most of the time. There was a recent change in ollama regarding tool ids in calls, it might be related.
I also tried the Zed assistant, it works with both models, even if it didn't seem great overall (but IDK).
Oh, sorry, you're right. I actually increased it, but decreased it recently and forgot about it. gpt-oss:20b works now, while qwen3-coder:30b still doesn't show any output most of the time. It's slower, probably, but it was working "fine" in Zed, as I mentioned.
I tried --print-logs, but by default I only get:
INFO 2025-11-20T06:01:25 +130ms service=default version=1.0.80 args=["--print-logs"] opencode
ERROR 2025-11-20T06:02:40 +75238ms service=acp-command promise={} reason=EditBuffer is destroyed Unhandled rejection
ERROR 2025-11-20T06:02:40 +0ms service=default e=EditBuffer is destroyed rejection
ERROR 2025-11-20T06:02:40 +0ms service=default Error: EditBuffer is destroyed
I think Zed uses the native ollama endpoints instead of openai compatible ones, those other ones support the client setting context stuff the openai compat ones dont
Ok, I think I get the problem. It's just slow.
opencode is probably adding a ton of system prompt as context, and I am on a CPU, so, it takes long to generate a response.
I switched to gpt-oss model (I think that's irrelevant, though, with qwen2.5-coder:7b-32k it took almost 30 minutes) with
opencode run "what is the capital of France?" --print-logs --log-level DEBUG --model ollama/gpt-oss
and it took 7 minutes to get the answer, during which ollama logged this:
seems to be revealing that the prompt being sent is around 9k tokens, even to know the capital of France ... and it's being truncated notwithstanding the 32k of context the model has (must be an ollama setting).
The relevant thing appears to be that in my configuration (CPU, 32GB of RAM) it is impossible to use local llms with large contexts. Thus using opencode (or Zen, for that matter, which gives me pretty similar results), is virtually impossible.
I'd close the issue, as this seems not to be fully relevant for the opencode repo.
Activity
lnicola commentedon Nov 19, 2025
Can't reproduce (
@ai-sdk/openai-compatibleworks fine for me), but I can confirm there's no error reporting whatsoever.rekram1-node commentedon Nov 19, 2025
@guglielmo maybe try:
opencode run hello --print-logsand show us the output
lnicola commentedon Nov 20, 2025
Actually, I take that back. I can chat, but doing anything that involves tools (like
/init) seems to fail withgpt-oss:20b, whileqwen3-coder:30bdoesn't even respond with anything most of the time. There was a recent change in ollama regarding tool ids in calls, it might be related.I also tried the Zed assistant, it works with both models, even if it didn't seem great overall (but IDK).
rekram1-node commentedon Nov 20, 2025
Whats ur ollama context size, prolly related to that by default it has 4k context or something so nothing will work
lnicola commentedon Nov 20, 2025
Oh, sorry, you're right. I actually increased it, but decreased it recently and forgot about it.
gpt-oss:20bworks now, whileqwen3-coder:30bstill doesn't show any output most of the time. It's slower, probably, but it was working "fine" in Zed, as I mentioned.I tried
--print-logs, but by default I only get:EDIT: hmm, that's a lot of context.
rekram1-node commentedon Nov 20, 2025
I think Zed uses the native ollama endpoints instead of openai compatible ones, those other ones support the client setting context stuff the openai compat ones dont
guglielmo commentedon Nov 20, 2025
@rekram1-node
I am using a model derived from qwen2.5-coder:7b with this Modelfile:
I invoke opencode like this:
The logs of
ollama serverunning in another terminal tab shows nothing.After about 2 minutes I CTRL+C the
opencodecommand and I get these logs in the ollama logs:guglielmo commentedon Nov 20, 2025
Ok, I think I get the problem. It's just slow.
opencode is probably adding a ton of system prompt as context, and I am on a CPU, so, it takes long to generate a response.
I switched to gpt-oss model (I think that's irrelevant, though, with qwen2.5-coder:7b-32k it took almost 30 minutes) with
and it took 7 minutes to get the answer, during which ollama logged this:
and this
seems to be revealing that the prompt being sent is around 9k tokens, even to know the capital of France ... and it's being truncated notwithstanding the 32k of context the model has (must be an ollama setting).
The relevant thing appears to be that in my configuration (CPU, 32GB of RAM) it is impossible to use local llms with large contexts. Thus using opencode (or Zen, for that matter, which gives me pretty similar results), is virtually impossible.
I'd close the issue, as this seems not to be fully relevant for the opencode repo.
rekram1-node commentedon Nov 20, 2025
It's because of tools primarily, they slow local models down a lot
Add OpenCode to Brewfile