anomalyco / anomalyco/opencode
cli: provider stream failures retry silently forever - looks like a hang with no console feedback
@jlongster is already working on this.
Since Sep 14, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Summary
Selecting a model whose upstream endpoint fails (currently opencode-go/deepseek-v4.1-flash, which returns HTTP 503 "Endpoint is unavailable" from the Zen Go router) makes OpenCode retry the stream silently and indefinitely. The CLI produces no output and no error, so a 1.6-second upstream failure looks like an endless hang.
Environment
- opencode version: 2.0.3
- OS: Windows 10 Pro 10.0.19045 (MINGW64_NT-10.0-19045, x86_64)
- Terminal: Windows console, TERM=xterm-256color
- Shell: Git Bash (bash 3.6.10, MINGW64)
- Install/channel: latest, npm package
@opencode/cli@2.0.3 - Active plugins:
@franlol/opencode-md-table-formatter@latest,@prevalentware/opencode-goal-plugin(the goal plugin currently fails to load with a SchemaError — unrelated, noted for completeness)
Reproduction
- Run against the shared background service:
timeout 90 opencode run -m opencode-go/deepseek-v4.1-flash "Reply with exactly: OK" - Observe: no output, no error, process never exits. After 90s
timeoutkills it (exit 124) with 0 bytes of output. - Direct test bypassing OpenCode confirms the trigger — POST to
https://opencode.ai/zen/go/v1/chat/completionswithx-opencode-sessionheader:- model
deepseek-v4.1-flash→ HTTP 503 in ~1.6s:{"error":{"type":"server_error","message":"Error from provider (Console Go): Upstream request failed: Endpoint is unavailable."}} - control model
deepseek-v4-pro→ HTTP 200 in ~2s, normal completion.
- model
Expected Behavior
The client should surface an error such as "provider request failed (503): Endpoint is unavailable" and stop (or retry a bounded number of times with visible feedback), instead of waiting forever with no console messages.
Actual Behavior
- The client submits the message and holds
GET /api/eventandPOST /api/session/<id>/waitopen; the server never completes the session. ~/.local/share/opencode/log/opencode.logfor the hung session shows nostream providerID=...entry, no retry entries, and no provider error — nothing betweencli startingand the eventual client-side interrupt.- Earlier logs (Aug 14) show the same class of failure with a silent retry loop: repeated
stream providerID=opencode-go ...+llm runtime selectedentries every ~7s for a minute+, never surfaced to the user.
Additional Context
- Reproduces consistently for this model; started right after the model appeared in the catalog (release_date 2026-09-10). Works fine with
opencode-go/deepseek-v4-proandopencode-go/deepseek-v4-flash(both verified end-to-end). - Workaround: use
opencode-go/deepseek-v4-prooropencode-go/deepseek-v4-flash. - Side observation: the official
deepseek/deepseek-v4-flashprovider also stalls (API returns 200 headers but the body never completes) — separate upstream issue.
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.
Assessment
This issue has not been assessed yet.