fix(providers/openai): emit source parts for Responses API streaming - #187
Merged
andreynering merged 1 commit intoMar 25, 2026
Conversation
…annotations The Responses API streaming path was missing a handler for "response.output_text.annotation.added" events. This meant that url_citation and file_citation annotations—which carry source URLs and titles for web search results—were silently dropped during streaming. The non-streaming Generate path and the Chat Completions API streaming path both handled annotations correctly; only the Responses API Stream path was affected. Add a case for "response.output_text.annotation.added" that parses the annotation map and yields StreamPartTypeSource parts for url_citation and file_citation types, matching the behavior of the existing Generate path and the Anthropic provider. Update TestResponsesStream_WebSearchResponse to include annotation.added events in the mock stream and assert that source parts are emitted with the correct URL, title, and type.
taigrr
pushed a commit
to taigrr/fantasy
that referenced
this pull request
Apr 20, 2026
…annotations (charmbracelet#187) The Responses API streaming path was missing a handler for "response.output_text.annotation.added" events. This meant that url_citation and file_citation annotations—which carry source URLs and titles for web search results—were silently dropped during streaming. The non-streaming Generate path and the Chat Completions API streaming path both handled annotations correctly; only the Responses API Stream path was affected. Add a case for "response.output_text.annotation.added" that parses the annotation map and yields StreamPartTypeSource parts for url_citation and file_citation types, matching the behavior of the existing Generate path and the Anthropic provider. Update TestResponsesStream_WebSearchResponse to include annotation.added events in the mock stream and assert that source parts are emitted with the correct URL, title, and type.
taigrr
pushed a commit
to taigrr/fantasy
that referenced
this pull request
Apr 25, 2026
…annotations (charmbracelet#187) The Responses API streaming path was missing a handler for "response.output_text.annotation.added" events. This meant that url_citation and file_citation annotations—which carry source URLs and titles for web search results—were silently dropped during streaming. The non-streaming Generate path and the Chat Completions API streaming path both handled annotations correctly; only the Responses API Stream path was affected. Add a case for "response.output_text.annotation.added" that parses the annotation map and yields StreamPartTypeSource parts for url_citation and file_citation types, matching the behavior of the existing Generate path and the Anthropic provider. Update TestResponsesStream_WebSearchResponse to include annotation.added events in the mock stream and assert that source parts are emitted with the correct URL, title, and type.
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.
The Responses API streaming path was missing a handler for "response.output_text.annotation.added" events. This meant that url_citation and file_citation annotations—which carry source URLs and titles for web search results—were silently dropped during streaming.
The non-streaming Generate path and the Chat Completions API streaming path both handled annotations correctly; only the Responses API Stream path was affected.
Add a case for "response.output_text.annotation.added" that parses the annotation map and yields StreamPartTypeSource parts for url_citation and file_citation types, matching the behavior of the existing Generate path and the Anthropic provider.
Update TestResponsesStream_WebSearchResponse to include annotation.added events in the mock stream and assert that source parts are emitted with the correct URL, title, and type.
CONTRIBUTING.md.