anomalyco / anomalyco/opencode

opencode-go: GLM-5.3-Flash long streams cut off without finish_reason, repeated retries

Open
#50,146 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
Avg merge
7h 2m
Merged PRs (30d)
384

Description

Description

When using OpenCode Go with opencode-go/glm-5.3-flash, long-running streams are cut mid-generation. The SSE stream ends with HTTP 200 but no finish_reason, so opencode shows:

⚠ Retry due · attempt N · OpenAI Chat stream ended without finish_reason

and automatically retries (observed up to attempt 4). This happens on nearly every long request. The same client on the same network does not show this with other providers, and the connection is direct (no VPN/proxy), so it looks like the Go gateway or its edge is cutting long-lived streams.

Impact: retries eventually succeed, but long tasks gain several minutes of wall time and each attempt re-bills tokens.

Example request configuration from the TUI stats page (shown to illustrate the endpoint, not necessarily the failing request itself):

  • Endpoint: /inference/go/openai/v1/chat/completions (protocol openai-chat, product go, provider OpenCode Go)
  • HTTP 200, streaming: yes

Observed cuts from the TUI during a single Build turn with GLM-5.3-Flash: Retry due · attempt 2/3/4 · OpenAI Chat stream ended without finish_reason, with streams running ~1m50s to ~12m27s at ~24–34 tok/s before being cut.

Plugins

None

OpenCode version

2.0.10

Steps to reproduce

  1. Connect OpenCode Go and select opencode-go/glm-5.3-flash (reasoning effort max observed on affected runs)
  2. Run a long Build task that generates for several minutes
  3. Watch for ⚠ Retry due · attempt N · OpenAI Chat stream ended without finish_reason

Screenshot and/or share link

No share link yet; happy to run /share and post it on request.

Operating System

Ubuntu 24.04 (Linux 6.14.0-29-generic, x86_64)

Terminal

xterm-256color (truecolor)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the long-stream failure through /inference/go/openai/v1/chat/completions with opencode-go/glm-5.3-flash, using the reported retry message and stream durations as evidence. Obtain the promised share link or equivalent logs, then identify whether the gateway or its edge ends the HTTP 200 stream; done means affected streams end with a finish_reason and do not trigger retries.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.