anomalyco / anomalyco/opencode
[BUG] Go service /v1/responses returns HTTP 200 but emits an incomplete SSE event stream, breaking Codex-style clients
@fwang is already working on this.
Since Aug 2, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Summary
The Go service advertises POST /v1/responses and returns valid JSON for non-streaming requests, but streaming responses emit an incomplete SSE event sequence. The stream is missing the response.output_item.added and response.content_part.added events that OpenAI Responses-API clients (e.g. the Codex CLI) rely on to parse output incrementally. In practice the client only receives response.output_text.delta → response.completed → [DONE], which does not constitute a valid Responses-API stream.
Reproduction
- Point the Codex CLI at the Go service (in
~/.codex/config.toml):base_url = https://opencode.ai/zen/go/v1wire_api = responses- model:
deepseek-v4-flash
- Run any prompt. Codex fails to parse the stream and the turn errors out or hangs.
- Raw SSE captured from
POST /v1/responseswith"stream": true:
event: response.output_text.delta
data: {"type":"response.output_text.delta","delta":"ok",...}
event: response.completed
data: {"type":"response.completed","response":{...}}
data: [DONE]
event: ping
data: {"type":"ping","cost":"0"}
Note the absence of response.created, response.in_progress, response.output_item.added, response.content_part.added, and response.output_item.done.
Expected behavior
A standard Responses-API SSE stream:
event: response.created
event: response.in_progress
event: response.output_item.added (message item)
event: response.content_part.added (output_text part)
event: response.output_text.delta ...
event: response.output_item.done
event: response.completed
Impact
- Non-streaming
POST /v1/responsesreturns a complete object and works via curl. - Streaming is what Codex-style clients actually use; with the current event set they cannot render or complete a turn.
Related
- #39829 (feature request for DeepSeek V4 Flash Responses API on Go)
- #23655 (Responses API support for the Go service)
- PR #40011 (
feat(core): support response-shaped catalog models) appears to be the fix in progress, but has not been merged yet.
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.