Prerequisites
Description
Some OpenAI-compatible Responses providers emit truncation: "" in response.created. BifrostResponsesResponse.WithDefaults() currently defaults only a nil value, so the empty string is forwarded unchanged.
Strict Responses clients accept only auto or disabled. Grok Build 1.0.5 rejects the empty value before processing the rest of the stream, even though the upstream response otherwise completes successfully.
Steps to reproduce
- Send a streaming Responses request through Bifrost to an OpenAI-compatible provider that emits an empty
truncation value.
- Inspect the forwarded
response.created event.
- Observe
"truncation":"" instead of a valid enum value.
Minimal schema reproduction:
resp := (&BifrostResponsesResponse{Truncation: schemas.Ptr("")}).WithDefaults()
fmt.Println(*resp.Truncation) // currently prints an empty string
Expected behavior
Missing or empty truncation values are normalized to disabled. Valid values such as auto and disabled are preserved.
Actual behavior
An explicit empty string bypasses the default and is emitted on the wire, causing strict Responses clients to 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)
Prerequisites
devbranch.Description
Some OpenAI-compatible Responses providers emit
truncation: ""inresponse.created.BifrostResponsesResponse.WithDefaults()currently defaults only a nil value, so the empty string is forwarded unchanged.Strict Responses clients accept only
autoordisabled. Grok Build 1.0.5 rejects the empty value before processing the rest of the stream, even though the upstream response otherwise completes successfully.Steps to reproduce
truncationvalue.response.createdevent."truncation":""instead of a valid enum value.Minimal schema reproduction:
Expected behavior
Missing or empty
truncationvalues are normalized todisabled. Valid values such asautoanddisabledare preserved.Actual behavior
An explicit empty string bypasses the default and is emitted on the wire, causing strict Responses clients to reject the stream.
Affected area(s)
Core (Go)
Version
Reproduced on
transports/v1.6.11and currentdev(0ac7f7142).Environment
Severity
Medium (some functionality impaired)