anomalyco / anomalyco/opencode

cli: provider stream failures retry silently forever - looks like a hang with no console feedback

Open
#49,030 1 comment 0 reactions 1 assignee View on GitHub

@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

  1. Run against the shared background service:
    timeout 90 opencode run -m opencode-go/deepseek-v4.1-flash "Reply with exactly: OK"
    
  2. Observe: no output, no error, process never exits. After 90s timeout kills it (exit 124) with 0 bytes of output.
  3. Direct test bypassing OpenCode confirms the trigger — POST to https://opencode.ai/zen/go/v1/chat/completions with x-opencode-session header:
    • 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.

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/event and POST /api/session/<id>/wait open; the server never completes the session.
  • ~/.local/share/opencode/log/opencode.log for the hung session shows no stream providerID=... entry, no retry entries, and no provider error — nothing between cli starting and 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 selected entries 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-pro and opencode-go/deepseek-v4-flash (both verified end-to-end).
  • Workaround: use opencode-go/deepseek-v4-pro or opencode-go/deepseek-v4-flash.
  • Side observation: the official deepseek/deepseek-v4-flash provider also stalls (API returns 200 headers but the body never completes) — separate upstream issue.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.