Repository navigation
fix(tool-call-repair): bound serialized stream normalization - #104100
Conversation
Co-authored-by: wuqingxuan <[email protected]> Co-authored-by: 徐闻涵0668001344 <[email protected]> Co-authored-by: qingminlong <[email protected]> Co-authored-by: WangYan <[email protected]>
|
Land-ready proof for
Native |
|
Merged via squash.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8720b33ccb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| ### Fixes | ||
|
|
||
| - **Plain-text XML tool calls:** repair zero-argument calls and keep byte/character-bounded stream normalization from leaking incomplete or oversized tool syntax while preserving visible suffix text. (#98984, #102240, #102933, #102975, #103220, #103585) Thanks @wangyan2026, @qingminglong, @wuqxuan, and @ZOOWH. |
There was a problem hiding this comment.
Remove the manual changelog entry
AGENTS.md says CHANGELOG.md is release-only and that release generation owns it, so adding this Unreleased note in a normal fix commit bypasses the release-note pipeline and can leave duplicate or stale generated release notes. Put this release-note context in the PR body, squash/direct commit message, or the release generator input instead of editing the changelog here.
Useful? React with 👍 / 👎.
…w#104100) * fix(tool-call-repair): bound serialized stream normalization Co-authored-by: wuqingxuan <[email protected]> Co-authored-by: 徐闻涵0668001344 <[email protected]> Co-authored-by: qingminlong <[email protected]> Co-authored-by: WangYan <[email protected]> * fix(tool-call-repair): preserve strict scan narrowing * fix(tool-call-repair): lint serialized name validation * fix(tool-call-repair): replay split suffix whitespace * fix(tool-call-repair): cap complete-call whitespace * test(tool-call-repair): assert bounded whitespace replay --------- Co-authored-by: wuqingxuan <[email protected]> Co-authored-by: 徐闻涵0668001344 <[email protected]> Co-authored-by: qingminlong <[email protected]> Co-authored-by: WangYan <[email protected]>
What Problem This Solves
The zero-argument XML repair merged in #103220 left serialized plain-text tool calls with multiple parser and stream-normalization paths. Incomplete, oversized, or split calls could be exposed in terminal snapshots; mixed text/non-text streams could also lose ordering, native blocks, or visible prefix/suffix text.
This is a maintainer follow-up to #98984, #102240, #102933, #102975, #103220, and #103585.
Why This Change Was Made
Consolidate serialized-call recognition behind one canonical grammar and one ordered, byte/character-bounded stream projection. Preserve shipped bracket/XML compatibility while making executable zero-argument XML calls explicit, retaining native content blocks and stable content indexes, and keeping recognized incomplete or oversized known-call syntax fail-closed while malformed non-call text remains visible.
The refactor deletes the older duplicated stream-state matrix and keeps provider and embedded-agent terminal behavior aligned.
User Impact
Models that serialize tool calls as text no longer leak incomplete/oversized syntax or lose surrounding visible text and native blocks. Valid shipped formats continue to execute, including legacy implicit-close parameter calls; explicit zero-argument XML calls now repair consistently across provider streams, terminal snapshots, and embedded runs.
Evidence
8720b33ccbc90c2f7619e6b7c80f6aee215901aa: full build; two loopback Responses requests;session_statusstart/result; finalTOOLCALL_LIVE_OK; raw XML absent from events, history, transcript, and Gateway logsContributor credit is retained for @wangyan2026, @qingminglong, @wuqxuan, and @ZOOWH.
No agent transcript is attached.