Skip to content

Zen: deepseek-v4.1-flash reasoning stream degenerated into repetition loops for ~10 min, self-recovered (suspected bad replica / prefix cache) #56781

Closed as not planned

Description

@wangwindlong

Description

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
  • failure timestamps: 2026-10-18 18:22:46 / 18:26:34 / 18:29:23 (+08:00) (= 10:22–10:30 UTC)
  • prompt size per turn: ~283k tokens (long agent session, 1M ctx, reasoning_effort=max, ~95% cache_read hit)
  • 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)

Operating System

Linux (client side)

Terminal

n/a

Activity

  1. opencode-agent commented on Oct 18, 2026

    @opencode-agent
    Contributor

    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.

    Related reports, for context:

    The bot will close this issue in 1 day.

  2. opencode-agent commented on Oct 19, 2026

    @opencode-agent
    Contributor

    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.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions