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
Zen gateway (/go/v1) streaming: tool_calls continuation deltas send "id":null / "function":{"name":null} instead of omitting absent fields #43328
Streaming chat completions from the Zen gateway (https://opencode.ai/zen/go/v1/chat/completions) emit tool_calls continuation deltas with explicit null values for id and function.name instead of omitting the absent fields, as the OpenAI streaming format specifies.
The first tool_calls delta of a call carries the real values, e.g.:
This breaks strict OpenAI-compatible clients that accumulate deltas and treat any present field as an update. Concrete case: DeepSeek Harness (dsh) accumulates if (call.function?.name !== undefined) block.name = call.function.name — the null overwrites the previously accumulated name, and every tool call ends up dispatched as unknown tool "". The same request non-streamed returns a correct message.tool_calls[] with id and function.name intact.
Observed model: deepseek-v4-flash (stream mode). The behavior is intermittent across time windows — client-side session logs show tool calls failing on 2026-08-17 ~04:34–12:08 UTC and 2026-08-19 ~02:37–02:50 UTC, while requests outside those windows (e.g., all of 2026-08-18) received spec-compliant chunks with the fields omitted. That pattern suggests different upstream backends behind the gateway, some of which emit null-filled deltas.
Plugins
n/a
OpenCode version
n/a — Zen gateway (opencode.ai/zen/go/v1), captured 2026-08-19 02:56 UTC
The streamed SSE shows the chunk sequence quoted above: id/name present on the first tool_calls delta, explicit null on the continuation deltas.
Expected: continuation deltas omit id / type / function.name when they carry no value (per the OpenAI streaming format), so field-presence-based delta accumulators keep the values from the first delta.
Activity
github-actions commentedon Aug 19, 2026
This issue might be a duplicate of existing issues. Please check:
function.name: nullin streaming tool-call continuation deltas breaks OpenAI-compatible clients. That issue tracks the client-side validation failure; this issue identifies the Zen gateway as the source of the non-spec-compliantnull-filled deltas.deepseek-v4-flashviaopencode.ai/zen/godrops tool calls after text output — same gateway + DeepSeek streaming + tool_calls combination, different failure mode.deepseek-v4-flash-free(zen free tier): stream drops the final text delta beforetool_calls; non-streaming is complete #40959: Zen free-tier stream drops the final text delta beforetool_calls— same intermittent pattern tied torouter-*vsuuidbackend routing.github-actions commentedon Oct 19, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.