anomalyco / anomalyco/opencode

[BUG] Go service /v1/responses returns HTTP 200 but emits an incomplete SSE event stream, breaking Codex-style clients

Open
#40,171 6 comments 2 reactions 1 assignee View on GitHub

@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.deltaresponse.completed[DONE], which does not constitute a valid Responses-API stream.

Reproduction

  1. Point the Codex CLI at the Go service (in ~/.codex/config.toml):
    • base_url = https://opencode.ai/zen/go/v1
    • wire_api = responses
    • model: deepseek-v4-flash
  2. Run any prompt. Codex fails to parse the stream and the turn errors out or hangs.
  3. Raw SSE captured from POST /v1/responses with "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/responses returns 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

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.