Repository navigation
fix(streaming): preserve tool-call boundaries and reject injected Markdown items - #2927
Merged
Merged
Conversation
…kdown items Co-authored-by: Aurantium🍊 <[email protected]> Co-authored-by: Afonso Ribeiro <[email protected]> Co-authored-by: Eric Del Orefice <[email protected]> Co-authored-by: Chen Yufeiyang <[email protected]>
This was referenced Nov 5, 2026
3 tasks done
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.
Stream complete native items incrementally without rescanning earlier characters. Keep fragments from separate OpenAI tool-call indices together and release upstream SDK streams on exhaustion, early close, and parse errors. Report an unfinished item at EOF.
For Markdown, hold prose candidates until the first fence or EOF. Emit fenced items immediately, preserve all bare items in order when there is no fence, and retain explicit eager extraction for callers that know their stream is bare JSON. Single-model Markdown continues selecting the last valid answer.
Tests cover actual SDK chunks, the public synchronous and asynchronous Iterable parsers, chunk boundaries, input limits, early closure and HTTP connection reuse.
Fixes #2745, fixes #2889.
Consolidates #2855, #2813, #2751, #2747.