Skip to content

[Bug]: response.output_item.added message items may omit required content array #6487

Description

@Alex-wangyang

Prerequisites

  • I searched existing issues and pull requests for duplicates.
  • I reproduced the behavior on the current dev branch.

Description

An OpenAI-compatible Responses upstream may omit item.content from the initial response.output_item.added event for an assistant message. Bifrost currently forwards the missing field unchanged.

Strict Responses clients expect message items to contain a content array from the moment the item is added, even before the first content part arrives. Grok Build 1.0.5 rejects the event when content is absent.

Steps to reproduce

  1. Stream a Responses request through Bifrost.
  2. Have the upstream emit response.output_item.added with an item whose type is message, but without content.
  3. Inspect the normalized event sent to the client.

Example upstream event:

{"type":"response.output_item.added","item":{"id":"msg_1","type":"message","role":"assistant"}}

Expected behavior

Bifrost emits the message item with "content":[] while preserving all other item fields and without mutating the source object.

Actual behavior

The content field remains absent, and strict Responses clients reject the stream.

Affected area(s)

Core (Go)

Version

Reproduced on transports/v1.6.11 and current dev (0ac7f7142).

Environment

Client: Grok Build 1.0.5
API: streaming Responses
Provider shape: OpenAI-compatible Responses

Severity

Medium (some functionality impaired)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    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