OpenCode now treats empty model turns as errors instead of successful assistant replies
CyberPunk-2022 · ghdev · 2026-07-19
OpenCode now surfaces empty provider responses as errors
This PR changes OpenCode's session handling so that if a provider returns stop plus usage data but no text and no tool call, the turn is no longer recorded as a successful assistant response. Instead, OpenCode stores an EmptyResponseError and emits a session error event.
Key points
- The finish reason and usage are still preserved for debugging.
- The fix is intentionally harness-level; it does not try to explain why the provider returned an empty completion.
- Tests were added and passed, including a regression that simulates a stop stream with usage but no text or tool call.
More from coding & agent
- Dev training a guard model to block prompt injection, tool and memory poisoning — gnukeith · 2026-10-27
- Mirendil debuts Fern, its first model with a 10M-token context window — shayan_ · 2026-10-27
- SF 'Code Engineering' event picks up where 1,000-person harness engineering meetup left off — LangChain · 2026-10-27
- Prompt turns Claude Code into an iPhone backup forensics tool exposing 30-day 'deleted' photo copies — alex_verem · 2026-10-27
- Prompt turns Claude Code into a forensics tool finding deleted iPhone photos in backups — alex_verem · 2026-10-27
- Phones won't be mobile IDEs but control planes for agent fleets, argues Yuchen Jin — Yuchenj_UW · 2026-10-27