Description
The LLM output gets stuck repeating the same sentence/phrase indefinitely. The model generates a few correct tokens, then enters a loop where it repeats the same text over and over and never emits a stop. This happens across multiple providers and in both the main agent and subagents, and I must abort the turn manually each time.
Steps to reproduce
Concrete repro (OpenCode Desktop, Windows 11):
- OpenCode Desktop 1.18.34, Windows 11 x64.
- Run a long-ish session (~30+ turns) on any model. I most reliably see it with:
opencode/longcat-2.5-preview-free (OpenCode Zen), or
- a DeepSeek-family model (
DeepSeek-V4-Flash via a local OpenAI-compatible endpoint).
- Send a follow-up prompt that continues prior work (e.g. "continue" or a small edit request).
- Observe: the assistant streams a partial answer, then repeats the same sentence (e.g. the last sentence it generated) over and over; output token count climbs; there is no error and no
finish; the turn never ends until I press Esc/abort.
It reproduces in the main agent and in subagents (explore/librarian-style task() dispatches), and in both normal and thinking modes. It is not tied to one provider — I have seen the same loop shape with OpenCode Zen, DeepSeek, and local models.
Expected behavior
opencode should detect repetitive output (same sentence/phrase repeated N consecutive times) and abort/retry the turn or surface a warning, instead of streaming forever until the user aborts.
OpenCode version
Desktop 1.18.34, Windows 11 x64 (Electron sidecar)
Plugins
No plugins (bare opencode). Affects the main agent and subagents alike.
Additional context
This is at the output-content level (the stream itself repeats), distinct from code-level session loops (#13577) or tool-call retry loops (#14087). Closest existing reports are per-model: #43146 (DeepSeek Flash v4), #44962 (reasoning repeats), #51503 (long-session degeneration), #25129 (thinking loop), #552 (long-session repetition). This one is broader — same behavior across providers and across both main/sub agents — so it is worth keeping open rather than closing into a single-model issue. Happy to attach a session log excerpt on next occurrence.
Description
The LLM output gets stuck repeating the same sentence/phrase indefinitely. The model generates a few correct tokens, then enters a loop where it repeats the same text over and over and never emits a stop. This happens across multiple providers and in both the main agent and subagents, and I must abort the turn manually each time.
Steps to reproduce
Concrete repro (OpenCode Desktop, Windows 11):
opencode/longcat-2.5-preview-free(OpenCode Zen), orDeepSeek-V4-Flashvia a local OpenAI-compatible endpoint).finish; the turn never ends until I press Esc/abort.It reproduces in the main agent and in subagents (explore/librarian-style
task()dispatches), and in both normal and thinking modes. It is not tied to one provider — I have seen the same loop shape with OpenCode Zen, DeepSeek, and local models.Expected behavior
opencode should detect repetitive output (same sentence/phrase repeated N consecutive times) and abort/retry the turn or surface a warning, instead of streaming forever until the user aborts.
OpenCode version
Desktop 1.18.34, Windows 11 x64 (Electron sidecar)
Plugins
No plugins (bare opencode). Affects the main agent and subagents alike.
Additional context
This is at the output-content level (the stream itself repeats), distinct from code-level session loops (#13577) or tool-call retry loops (#14087). Closest existing reports are per-model: #43146 (DeepSeek Flash v4), #44962 (reasoning repeats), #51503 (long-session degeneration), #25129 (thinking loop), #552 (long-session repetition). This one is broader — same behavior across providers and across both main/sub agents — so it is worth keeping open rather than closing into a single-model issue. Happy to attach a session log excerpt on next occurrence.