anomalyco / anomalyco/opencode
opencode-go: GLM-5.3-Flash long streams cut off without finish_reason, repeated retries
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(protocolopenai-chat, productgo, providerOpenCode 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
- Connect OpenCode Go and select
opencode-go/glm-5.3-flash(reasoning effortmaxobserved on affected runs) - Run a long Build task that generates for several minutes
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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