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
- GPT-6 Astra beats Factorio with enemies in 44 in-game hours at ~$4,500 API cost — liminal_bardo · 2026-09-11
- Treating agents like 50 First Dates: a 3-layer context system so every conversation doesn't start from zero — evielync · 2026-09-11
- SmolVM open-sources persistent computer infrastructure for agents that outlive chat sessions — aniketmaurya · 2026-09-11
- ARRM targets silent economic regressions in AI agents that functional tests miss — Beautiful_Belt_601 · 2026-09-11
- Dev builds browser 3D pizza delivery game with Claude: physics, GPS pathfinding, traffic AI — vinishkapoor · 2026-09-11
- Build X Carousel Posts from One Wide Image: A Splitter Tool Plus YouMind Skill Workflow — sujingshen · 2026-09-11