anomalyco / anomalyco/opencode
Assistant turn ends silently when model returns reasoning-only (empty text)
@kitlangton is already working on this.
Since Sep 12, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
Environment
opencode 1.18.30, Desktop app, Windows 10/11
Provider/model: deepseek/deepseek-flash (built-in deepseek provider), agent build
Reasoning display setting "Show reasoning summaries" was off at the time (default)
Summary Intermittently, an assistant turn produces no visible output at all — the message appears empty and the turn just ends. The answer was actually generated, but the model streamed it entirely into the reasoning channel with an empty normal-text channel (finish=stop, output=0). opencode hides reasoning by default, so the user sees a blank reply. No error is shown and no retry happens.
Steps to reproduce
Select deepseek/deepseek-flash and chat normally.
Ask a normal question (e.g. a documentation-style question).
Intermittently the assistant bubble is empty and the turn ends; re-sending the same message usually works.
Expected
Show the answer, or
If the step finishes with no text and no tool calls, surface a warning and/or automatically retry, instead of ending silently.
Actual Empty assistant turn, no output, no error.
Evidence Session ses_f8c20eceeffeweusSFtvoVF80T.
message.data for the broken turns shows finish="stop" with tokens.output=0:
msg_093c6c024001jKRKOGQ5rIYPvw → finish=stop, output=0, reasoning=634, cache.read=120960
msg_093ca3e5b001nahGAMQuOfssEj → finish=stop, output=0, reasoning=366, cache.read=125312
The part table for these messages contains only step-start, reasoning, step-finish — there is no text part. The full final answer is present inside the reasoning part.
Working comparison (same session):
msg_093c7885500150d6x7MbIpNj5V → finish=stop, output=261, reasoning=93, and a text part (length 567) → displays normally.
Verification: enabling Settings → General → "Show reasoning summaries" makes the previously "blank" turn show the full answer, confirming the content was in the reasoning channel all along.
Root cause The model/provider intermittently emits the entire response as reasoning content and an empty text content (reasoning-only completion). opencode renders only text parts by default, so a text-less step looks like a total failure.
Suggested fix
In the stream/loop completion handling: if a step ends with no text and no tool parts but has reasoning, either surface a visible warning or auto-retry the step (N times).
Optionally, fall back to rendering reasoning content when text is empty.
Consider a guard/telemetry counter for "empty assistant step" so this is diagnosable.
Note This may be an upstream model behavior; regardless, opencode should not silently end a turn with zero user-visible content.
Plugins
No response
OpenCode version
No response
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response
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.