fix: Handle more events#1164
Merged
BenjaminMichaelis merged 4 commits intoJun 1, 2026
Merged
Conversation
…eamingAsync The OpenAI SDK requires StreamingEnabled to be set to true on CreateResponseOptions when calling CreateResponseStreamingAsync. Also propagate StreamingEnabled in CloneOptionsWithPreviousResponseId so tool-call continuation legs behave consistently.
Handle StreamingResponseOutputTextDoneUpdate in the streaming loop. Some SDK/server combinations emit completed text parts without delta events, which previously produced only responseId + [DONE] on the SSE endpoint. Add per-part delta tracking to avoid duplicate text when both delta and done updates are present.
Handle StreamingResponseRefusalDeltaUpdate and StreamingResponseRefusalDoneUpdate in the streaming loop. This prevents empty SSE responses when the model returns refusal content via refusal events instead of output-text deltas.
Capture StreamingResponseErrorUpdate, StreamingResponseFailedUpdate, and StreamingResponseIncompleteUpdate so terminal stream failures are not silently treated as successful [DONE] completions.
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.
Description
Describe your changes here.
Fixes #Issue_Number (if available)
Ensure that your pull request has followed all the steps below: