Skip to content

Session idles silently when a turn ends with stop and no model output #50250

Closed as not planned

Description

@hiteshjain118

Description

A provider can end a stream early with a clean stop finish and 0 output tokens — no error, no text, no tool calls. opencode treats this as a normal end-of-turn: the prompt loop exits, the session idles, and the TUI shows nothing. From the user's perspective the session just stops mid-task, and nothing in the logs or transcript distinguishes the truncated turn from a deliberate completion.

We hit this with a self-hosted glm-5.3-fp4 endpoint. Two turns in one session (a coding turn and a reviewer subagent turn) ended with reason: "stop", output: 0, and reasoning cut mid-sentence at the same content position ~3s into each step. Step-finish parts from the session DB:

{"reason":"stop","type":"step-finish","tokens":{"total":126576,"input":559,"output":0,"reasoning":706,...}}
{"reason":"stop","type":"step-finish","tokens":{"total":126126,"input":123006,"output":0,"reasoning":1841,...}}

No errors, aborts, or retries in the server log — the provider returned a clean stop both times. Sending a fresh user message recovers, which points to a deterministic premature stop rather than a transient network failure.

There is currently no signal at all when this happens. A log warning and/or a UI indicator when a turn ends with stop, no error, and no visible output would make these turns diagnosable.

Plugins

None

OpenCode version

1.18.31

Steps to reproduce

Not reliably reproducible on demand — it depends on the provider emitting a premature clean stop. The signature in the session DB is an assistant message with finish: "stop", no error, no text or tool parts, and step-finish tokens with output: 0 (in our case with nonzero reasoning).

Operating System

macOS

Activity

  1. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions