Skip to content

OpenAI-compatible cost chunk omits required stream fields #39061

Closed as not planned

Description

@rixzkiye

Description

Zen appends an invalid cost event to OpenAI-compatible streams:

{"choices":[],"cost":"0"}

The event omits id, object, created, and model. Strict OpenAI chunk decoders parse every SSE data: event and fail with missing field id before they can ignore the cost metadata. Expected: retain cost inside a valid chat-completion chunk envelope.

Plugins

N/A

OpenCode version

Zen production endpoint, observed 2026-07-27

Steps to reproduce

  1. Send a streaming request through the Zen OpenAI-compatible endpoint.
  2. Parse every data: JSON event as an OpenAI chat completion chunk.
  3. Observe the final cost event fail schema deserialization because id is missing.

Screenshot and/or share link

N/A — failure occurs in the raw SSE response shown above.

Operating System

Linux

Terminal

zsh

Activity

  1. github-actions commented on Sep 29, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions