Repository navigation
tool parsing: treat literal tool XML in prose/quotes/fences as text for qwen4_exp (ported from Enntity; replaces #253) - #279
Merged
Conversation
…es and streams as text Enntity's literal tool-XML mechanism (b1b5381, 69d32d3, 1c1a8fe, AGPL-3.0-only): models whose tokenizers register tool-envelope XML as added tokens (glm5_next, qwen4_exp) get a tagged sentinel family so quoted <tool_call> markup in incoming message prose encodes as text, reasoning preserves bare/split markup until the think-end token, and detector-rejected envelopes stay content instead of being reparsed as bare/JSON calls. LeakMarkers.for_literal_xml preserves parseable- looking envelopes in the same models; bare-role literal filtering stays for all other families. Off for every other model type: glm_tool_markup_as_text only switches on for the two carriers. (cherry picked from commit 6d43eca)
(cherry picked from commit d05b77f)
…tive boundary (cherry picked from commit 9d432e6)
(cherry picked from commit 8a72757)
(cherry picked from commit c59752d)
(cherry picked from commit 208d70b)
… edits) (cherry picked from commit a085714)
…00-LoC cap, no logic edits) (cherry picked from commit 52d5ca2)
(cherry picked from commit ed431aa)
…eral_leaks, native_opener grammar arms, set_complete_poolside_calls)
…same exemption as its parent)
The LoC split left the doc comment above the `mod omni_pads` declaration, which clippy rejects (`empty_line_after_doc_comments`). The text is unchanged. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…hen -> map The path-sibling splits moved `finalize_response`, `advance_name_run` and `marker_prefix_hold_start` but left their doc comments above the `mod` lines (clippy `empty_line_after_doc_comments`). The text is unchanged. `inner.rs` takes 0.4.0's `.map` form (clippy `bind_instead_of_map`). Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This was referenced Oct 31, 2026
Merged
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.
Summary
Replaces #253. Same port, re-cut onto main without the GLM (#199) dependency.
b1b53814,fbda04d1,69d32d3e,1c1a8fee), plus the fixes we made while porting, with credit in each commit.qwen4_exp; other model types are unchanged.native_opener/with_native_opener/opens_output,role_literal_leaks). glm5_next behaviour on main is unchanged.handle_token/inner.rs(544 LoC) is the single function extracted fromhandle_token.rs, which is already on the file-size allow-list. It gets the same exemption, listed next to its parent in.github/workflows/file-size-cap.yml.Test plan
literal_xml11,tool_security10 andglm_tool_boundary24 all pass (reiner). clippy and fmt are clean.48f73b27cvs this branchb0df9c209. Receipts are in reiner's~/code/night1027/out/litxml-b0df9c209/.run-1793435783103906797). Main scores the same, 87.54 / 86.85 (run-1793428757486602038). One run per arm.Part of bringing SparkQwen 0.4.0 onto main (#220). The tool and grammar follow-ups (the tool-call-or-JSON union and the 10-22 literal-XML fixes) are stacked on this branch as the next PR.
Generated with Devin