anomalyco / anomalyco/opencode

Go: hy3 stream returns empty event-stream (non-stream 200 OK)

Open
#43,851 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Model: hy3 via https://opencode.ai/zen/go/v1/responses (Go models list contains hy3/hy3-preview)
Auth: ZEN_API_KEY (sk-Eh5x...)

Repro (non-stream OK):

curl -X POST https://opencode.ai/zen/go/v1/responses \
  -H "Authorization: Bearer $ZEN_API_KEY" -H "Content-Type: application/json" \
  -d '{"model":"hy3","reasoning":{"effort":"low"},"input":[{"role":"user","content":[{"type":"input_text","text":"write a haiku about code"}]}]}'

-> 200 JSON with output_text OK, all efforts minimal/low/medium/high/max/xhigh/ultra/none pass

Repro (stream FAIL - empty):

curl -N -v -X POST https://opencode.ai/zen/go/v1/responses \
  -H "Authorization: Bearer $ZEN_API_KEY" -H "Accept: text/event-stream" -H "Content-Type: application/json" \
  -d '{"model":"hy3","reasoning":{"effort":"low"},"stream":true,"input":[{"role":"user","content":[{"type":"input_text","text":"write a haiku about code"}]}]}'

-> HTTP 200 content-type: text/event-stream but 0 events for >3s, only blank lines. No response.created/output_text.delta/response.completed.

Control (same request, other models OK):

  • deepseek-v4-flash stream:true -> has response.created/in_progress/delta/completed (native responses)
  • mimo-v2.5 stream:true -> has naked delta (needs proxy _complete_sse_frame, but not empty)
  • hy3 non-stream is the only one that works, so Wire is not chat-adapted; stream path seems not wired

Impact: Codex is streaming-only, so hy3 via hy3-go hangs as "thinking forever" then dumps truncated implicit reasoning as garbled text. Non-stream alone cannot be used. Proxy cannot fix empty stream (only missing frames, see vision_proxy.py:_complete_sse_frame). We have removed hy3-go from local models.json (13 models, hy3/hy3-preview kept in _SEARCH_FALSE as guard).

Expected: hy3 stream:true should emit standard Responses SSE like deepseek-v4-flash / gpt-5.6-luna.

Env: opencode.ai Go, 2026-08-21 19:59 CST, hy3 context 262144 / max 128000 / text->text / 295B MoE 21B active (OpenRouter tencent/hy3), curl 8.7.1, h2. hy3-preview same behavior, occasionally Model is unavailable.

Thanks for fixing similar deepseek-v4-pro web_search 400 (#42090) and PR #40210 — same Go gateway.

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 empty SSE response with the provided curl request, then inspect the Go gateway path and the referenced vision_proxy.py and models.json handling. Compare hy3 streaming with the working deepseek-v4-flash and mimo-v2.5 cases; done means hy3 and hy3-preview emit response.created, output_text.delta, and response.completed events rather than blank lines.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, typescript
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.