You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Zen: deepseek-v4.1-flash reasoning stream degenerated into repetition loops for ~10 min, self-recovered (suspected bad replica / prefix cache) #56781
Using the Zen Go OpenAI-compatible endpoint (https://opencode.ai/zen/go/v1) with model=deepseek-v4.1-flash (streaming, x-opencode-session header set), three consecutive requests degenerated into reasoning-channel repetition loops:
好。
好。
好。
(调用)
好。
... (16,007 chars accumulated before the first client-side check; loop already dominating the whole tail)
Another turn looped on a periodic unit (~33k chars):
好。 → 执行。 → (go) → **执行** ✓ → (工具调用) → repeat dozens of times
The visible content channel produced nothing; completion tokens kept burning on pure reasoning echo. The client's runaway-repetition guard cut the stream and discarded the partial output (by design), so the turns errored out.
Request context
x-opencode-session: e4a000cc9d5e — same key used by all prior successful turns
the same session completed 15+ turns on this model earlier the same day (02:27–15:13 +08:00); 0 failures before, 0 after (model switched as a workaround)
Ruled out client-side (~2h later, 22:00+ +08:00)
Replayed a ~220k-token payload built from the same session's real content:
request variant
same x-opencode-session key
fresh key
default params
clean finish_reason=stop
clean
thinking:{type:enabled}
clean
clean
reasoning_effort:"max"
clean
clean
Trivial prompts: clean. Cannot reproduce anymore.
Suspected cause
Transient serving-side degradation for this model during that window — a bad replica, or a corrupt/poisoned prefix-cache segment pinned to this session's cache (requests reuse the same affinity key, and cache_read was ~95%).
Steps to reproduce
Not reproducible after the window. Reproduction attempts (all clean, finish_reason=stop): ~220k-token replay payload × {same affinity key, fresh key} × {default, thinking:{type:enabled}, reasoning_effort:"max"}, plus trivial prompts. Client-side logs and the failed-stream transcripts are available on request.
Screenshot and/or share link
n/a — text transcripts available on request.
OpenCode version
n/a (API consumer — Hermes Agent, streaming via /v1/chat/completions with x-opencode-session set)
Thanks for the detailed report and for checking whether the problem was on your side first. A ~10-minute window where deepseek-v4.1-flash reasoning streams looped and then recovered, with no way to reproduce it afterwards, sounds like something on the Zen/Go serving side. Only the team can check that against their logs.
Problems with the OpenCode Go / Zen service and accounts aren't handled in GitHub issues. Please email help@anoma.ly with the details: the time window (2026-10-18, 10:22–10:30 UTC), the x-opencode-session key and the failed-stream transcripts. If you've already emailed, the team will get to it, especially now that we've seen it here. Please keep API keys, account emails and other account details out of this public issue and put them only in the email.
Closing this now, since problems with the Zen/Go service are handled by email rather than in GitHub issues. Thanks again for the careful write-up, @wangwindlong.
If you'd still like the team to look into the deepseek-v4.1-flash looping window, please email help@anoma.ly with the time range, session key and transcripts. Please keep API keys and account details out of this public issue and send them only by email.
Activity
opencode-agent commentedon Oct 18, 2026
Thanks for the detailed report and for checking whether the problem was on your side first. A ~10-minute window where
deepseek-v4.1-flashreasoning streams looped and then recovered, with no way to reproduce it afterwards, sounds like something on the Zen/Go serving side. Only the team can check that against their logs.Problems with the OpenCode Go / Zen service and accounts aren't handled in GitHub issues. Please email help@anoma.ly with the details: the time window (2026-10-18, 10:22–10:30 UTC), the
x-opencode-sessionkey and the failed-stream transcripts. If you've already emailed, the team will get to it, especially now that we've seen it here. Please keep API keys, account emails and other account details out of this public issue and put them only in the email.Related reports, for context:
deepseek-v4.1-flashon the same Zen Go route falling into repetition loops before tool calls (persistent rather than a short window)reasoning_text must be passed back400 #55584: repetition loop ondeepseek-v4.1-flashin long sessionsdeepseek-v4-flashrepeating a meaningless token in long tool-calling sessions on the Go planThe bot will close this issue in 1 day.
opencode-agent commentedon Oct 19, 2026
Closing this now, since problems with the Zen/Go service are handled by email rather than in GitHub issues. Thanks again for the careful write-up, @wangwindlong.
If you'd still like the team to look into the
deepseek-v4.1-flashlooping window, please email help@anoma.ly with the time range, session key and transcripts. Please keep API keys and account details out of this public issue and send them only by email.