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
- Karpathy shares CLAUDE.md rulebook to stop AI coding agents from piling up tech debt — mdancho84 · 2026-10-26
- Rethinking dependencies in the agent era: drop libs that save 20 lines of code — gethackteam · 2026-10-26
- RustGIS hits 2,000 GitHub stars in two weeks with agent-first architecture — giswqs · 2026-10-26
- Vercel Ships 12 New Products at Its 2026 Conference as It Races Rivals for the Agent Entry Point — FinanceYF5 · 2026-10-26
- Build an AI agent from scratch in under 50 lines of pure Python: ReAct loop tutorial — adnan_hashmi · 2026-10-26
- Dense instance segmentation via Muse Wonder + SAM 3.1 on Meta's Model API — nikhilaravi · 2026-10-26