Repository navigation
Hardening: tool-call parsing, streaming and grammar compiles - #4378
Merged
Merged
Conversation
ashhart
force-pushed
the
lead/harden-protocol
branch
from
November 21, 2026 21:34
7a238c8 to
d659901
Compare
ashhart
force-pushed
the
lead/harden-protocol
branch
from
November 22, 2026 09:16
d659901 to
69acdcb
Compare
- Harden streaming protocol parsing, schema checks, and model-family tool handling. - Cancel abandoned grammar budget work and release worker slots without moving cleanup onto callers. - Verify grammar ownership regressions and the real xgrammar v0.2.8 budget gate.
- Avoid a Zig local-name shadow in Responses reasoning translation. - Keep strict MiniMax schemas constrained while using a free-form body for non-strict calls. - Exercise real MiniMax element syntax, arbitrary properties, and parallel calls through xgrammar.
…ayed thought's own bytes The streamed envelope closer (tool_json_close.Closer) stepped past a '<' at the end of a feed whose '</tool_call>' had not fully arrived, and never looked at it again; it also decided JSON or not before the payload's first byte arrived and scanned a non-JSON payload's later feeds as JSON. A <tool_call> envelope the stream buffered (after a DSML block, or a rejected call) then never closed and its calls were lost, while the whole reply kept them. It now decides on the first non-blank byte, searches a non-JSON payload for the closer as text, and stops at a partial closer until the next feed. A replayed reasoning item's text went into an assistant message as a slice of the buffer the next reasoning item reused, so later items overwrote it; the message now takes a copy.
ashhart
force-pushed
the
lead/harden-protocol
branch
from
November 22, 2026 10:31
69acdcb to
db6d552
Compare
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.
Hardening of streamed protocol parsing, tool calls and grammar compilation, from an internal review:
$refschemas, required properties) before emitting them.Two follow-up commits move protocol helpers and a metrics test into their own files (600-line cap) and remove a shadowed name. Covered by host tests for tool parsing, grammar and the Responses routes.