Skip to content

fix(streaming): preserve tool-call boundaries and reject injected Markdown items - #2927

Merged
jxnl-oai merged 2 commits into
mainfrom
codex/backlog-iterable-streams
Nov 5, 2026
Merged

jxnl-oai merged 2 commits into
mainfrom
codex/backlog-iterable-streams

Conversation

@jxnl-oai

@jxnl-oai jxnl-oai commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

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.

jxnl-oai and others added 2 commits November 5, 2026 20:31
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant