You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Go gateway: SSE streaming requests over HTTP/1.1 return HTTP 500 (Endpoint is unavailable) #42843
Streaming (SSE) chat completion requests to the opencode-go gateway endpoint https://opencode.ai/zen/go/v1/chat/completions return HTTP 500 with body {"type":"error","error":{"type":"error","message":"Internal server error"}}when sent over HTTP/1.1. The same request over HTTP/2 succeeds (HTTP 200 with normal SSE chunks). Non-streaming requests over HTTP/1.1 also succeed.
This surfaces in OpenChamber/openCode sessions as AI_APICallError: Upstream request failed: Endpoint is unavailable. for provider opencode-go (e.g. deepseek-v4-flash), in recurring bursts (retries all fail for several minutes, then recover).
opencode CLI 1.18.18 (bun, HTTP/2) with opencode-go/deepseek-v4-flash works fine
Request body/headers captured from the working client and replayed via curl over HTTP/1.1 still 500s: {"model":"deepseek-v4-flash","max_tokens":32000,"top_p":0.95,"messages":[...],"tool_choice":"auto","stream":true,"stream_options":{"include_usage":true}}
Expected
Streaming over HTTP/1.1 should work like any OpenAI-compatible endpoint (other providers do). Or at minimum return a meaningful status/error instead of a generic 500.
If your issue is specifically about HTTP/1.1 streaming being broken while HTTP/2 streaming works (i.e. a protocol-level difference rather than intermittent unavailability), it may be distinct from the above — the HTTP/1.1 vs HTTP/2 reproduction steps make this a useful data point worth keeping separate if that distinction holds up.
Thanks for the duplicate check. This one is a distinct data point worth keeping: it isolates a deterministic protocol-level difference (HTTP/1.1 + SSE -> guaranteed 500; HTTP/2 + SSE -> 200, 100% reproducible in the same minute from the same machine/key/network), not intermittent unavailability.
Comparison with the referenced issues:
[BUG] OpenCode Go deepseek-v4-flash returns HTTP 500 while mimo-v2.5 works #40480 (flash 500 while mimo works): that report shows non-streaming also 500s during the outage window (Aug 4). In my case non-streaming over HTTP/1.1 consistently returns 200 — the failure is specific to streaming. Related, but the trigger differs.
OpenCode Go service (zen/go/v1) frequent intermittent outages — HTTP 000 / 503 / Cloudflare 524 #36889 (intermittent outages): my log shows the same recurring-burst pattern (Endpoint is unavailable in ~5-10 min bursts, e.g. 17:32-18:10 and 01:27-01:34 UTC), so the outage cluster likely explains the bursts users see in OpenChamber sessions. The h1.1-streaming 500 is an additional deterministic bug on top of that.
Reproduction is one curl call, so it's cheap for the assignee to verify: curl -X POST https://opencode.ai/zen/go/v1/chat/completions -H "Authorization: Bearer <key>" -d '{"model":"deepseek-v4-flash","messages":[{"role":"user","content":"hi"}],"stream":true}' -> HTTP 500; same request via HTTP/2 (node http2) -> 200.
Also worth noting for the outage angle: #40480 mentions an "OpenCode Go China-hosted model opt-in" console setting — my traffic is from a China IP; if that opt-in routes to different upstreams, it may be relevant to the burst pattern. Happy to close as duplicate of #40480 if maintainers prefer, but the h1.1/h2 repro is unique to this report.
Additional data point for the assignee: the account in question has the "Enable models hosted in China" opt-in enabled the whole time (and the failure is Endpoint is unavailable/500, never the 403 RegionError from the opt-in gate). So this is not the opt-in/RegionError class of issue (#39845) — it's the gateway's streaming path failing even for China-hosted routing. The h1.1-vs-h2 repro in the body stands as-is.
Activity
github-actions commentedon Aug 16, 2026
This issue might be a duplicate of existing issues. Please check:
Endpoint is unavailableerrors on the same endpoint with analysis of the Cloudflare/upstream relationshipUpstream request failed: Endpoint is unavailableon v1.18.18If your issue is specifically about HTTP/1.1 streaming being broken while HTTP/2 streaming works (i.e. a protocol-level difference rather than intermittent unavailability), it may be distinct from the above — the HTTP/1.1 vs HTTP/2 reproduction steps make this a useful data point worth keeping separate if that distinction holds up.
118Gavin commentedon Aug 16, 2026
Thanks for the duplicate check. This one is a distinct data point worth keeping: it isolates a deterministic protocol-level difference (HTTP/1.1 + SSE -> guaranteed 500; HTTP/2 + SSE -> 200, 100% reproducible in the same minute from the same machine/key/network), not intermittent unavailability.
Comparison with the referenced issues:
Endpoint is unavailablein ~5-10 min bursts, e.g. 17:32-18:10 and 01:27-01:34 UTC), so the outage cluster likely explains the bursts users see in OpenChamber sessions. The h1.1-streaming 500 is an additional deterministic bug on top of that.Reproduction is one curl call, so it's cheap for the assignee to verify:
curl -X POST https://opencode.ai/zen/go/v1/chat/completions -H "Authorization: Bearer <key>" -d '{"model":"deepseek-v4-flash","messages":[{"role":"user","content":"hi"}],"stream":true}'-> HTTP 500; same request via HTTP/2 (node http2) -> 200.Also worth noting for the outage angle: #40480 mentions an "OpenCode Go China-hosted model opt-in" console setting — my traffic is from a China IP; if that opt-in routes to different upstreams, it may be relevant to the burst pattern. Happy to close as duplicate of #40480 if maintainers prefer, but the h1.1/h2 repro is unique to this report.
118Gavin commentedon Aug 16, 2026
Additional data point for the assignee: the account in question has the "Enable models hosted in China" opt-in enabled the whole time (and the failure is
Endpoint is unavailable/500, never the 403 RegionError from the opt-in gate). So this is not the opt-in/RegionError class of issue (#39845) — it's the gateway's streaming path failing even for China-hosted routing. The h1.1-vs-h2 repro in the body stands as-is.thdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊