feat(core): add metadata field to ResponseItem#28355
Merged
Merged
Conversation
1537199 to
e5daf04
Compare
pakrym-oai
reviewed
Jun 15, 2026
| ResponseItem::FunctionCallOutput { | ||
| call_id: call_id.clone(), | ||
| output: FunctionCallOutputPayload::from_text("aborted".to_string()), | ||
| metadata: metadata.clone(), |
Collaborator
There was a problem hiding this comment.
Should this be None?
Collaborator
Author
There was a problem hiding this comment.
good catch, agreed
pakrym-oai
approved these changes
Jun 15, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
This PR adds an optional
metadatafield toResponseItemfor Responses API calls. Only mechanical plumbing, no actual values populated and sent yet. Turns out just adding a new field toResponseItemhas quite a large blast radius already.This change is backwards compatible because
metadatais optional and omitted when absent, so existing response items and rollout history without it still deserialize and requests that do not set it keep the same wire shape. For provider compatibility, we strip outmetadatabefore non-OpenAI Responses requests so Azure and AWS Bedrock never see this field.My followup PR here will actually make use of it to start storing and passing along
turn_id: #28360What changed
ResponseItemMetadatawith optionalturn_id, plus optionalmetadataon Responses API item variants and inter-agent communication.