Repository navigation
fix: OpenAI Responses stream reports a null response id - #322
Closed
cunninghamcard-bit wants to merge 1 commit into
Conversation
… never started @ai-sdk/openai 4.0.83 starts the stream's `responseId` at `null` (openai-responses-language-model.ts:1587) and only `response.created` sets it, so a stream without that event finishes with `responseId: null`. aimux wrote an empty string. The generate path already writes `null`. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RoxcKU4zBD64Lri3e4Lrq5
This was referenced Oct 20, 2026
Contributor
Author
|
Folded into #323 together with the other OpenAI fixes, so each vendor has one fix PR. This change is commit Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Before: an OpenAI or Azure Responses stream that never received
response.createdfinished withproviderMetadata.<key>.responseId: "".After: as in
@ai-sdk/openai4.0.83, it finishes withresponseId: null. The generate path already wrotenullfor a missing id.Found while porting the upstream Azure tests (case
responses › doStream › should handle file_citation annotations without optional fields in streaming). Part of the #276 list.How it works today
What this PR changes
Tests (
tests/openai_upstream_e2e_test.rs):a_stream_without_response_created_finishes_with_a_null_response_idstreams onlyresponse.completed; on master it fails withleft: String(""),right: Null. The upstream case is ported in the Azure test PR.Docs: CHANGELOG
Fixed.Type of change
Checklist
cargo +1.99 fmt -p aimux-providers -- --checkpassescargo +1.99 clippy -p aimux-providers --lib --tests -- -D warningspassescargo +1.99 test -p aimux-providers --test openai_upstream_e2e_testpasses (23)scripts/check_provider_boundaries.shpassesNotes for reviewers
Second of three OpenAI fixes (#321 file search integer ← this PR ← reasoning delta item id ← the Azure test PR). Nothing in the workspace reads
responseIdback from the finish metadata.Generated by Claude Code