Repository navigation
fix(chat): hold closing tags after empty XML parameters - #249
Merged
Vasyl-Trefilov merged 1 commit intoDec 6, 2026
Merged
Conversation
Co-Authored-By: Little Code Sauce <little-code-sauce@example.com> Signed-off-by: NginxL <8777777+NginxL@users.noreply.github.com>
Aletheore Flash reviewFlash review skipped: draft pull request. It will run when the pull request is marked ready for review. |
🔍 Aletheore evidence diffgraph LR
n0["src/chat.rs"]
n1["src/deepseek/chat.rs"]
n2["src/gemma4/mod.rs"]
n3["src/gigachat4/chat.rs"]
n4["src/glm/mod.rs"]
n5["src/hy4/chat.rs"]
n6["src/inkling2/chat.rs"]
n7["src/kolibri/chat.rs"]
n8["lib.rs"]
n9["main.rs"]
n10["src/raon/chat.rs"]
n11["src/serve.rs"]
n12["tests/serve.rs"]
n13["vision.rs"]
n0 --> n1
n0 --> n2
n0 --> n3
n0 --> n4
n0 --> n5
n0 --> n6
n0 --> n7
n0 --> n8
n0 --> n9
n0 --> n10
n0 --> n11
n0 --> n12
n0 --> n13
classDef changed fill:#d9772c,color:#fff,stroke:#b85f1c;
classDef changedFinding fill:#c0392b,color:#fff,stroke:#922b21;
classDef dependent fill:#f2f0ec,color:#18140f,stroke:#d6d0c5;
class n0 changed
class n1 dependent
class n2 dependent
class n3 dependent
class n4 dependent
class n5 dependent
class n6 dependent
class n7 dependent
class n8 dependent
class n9 dependent
class n10 dependent
class n11 dependent
class n12 dependent
class n13 dependent
What changed
Aggregate deltas
|
Member
|
Hi, ty, clean fix and a good test. I checked it: holding back both forms of the closing tag keeps every streamed piece a prefix of the final call, and non-empty values work like before. The chat tests pass. It is merged now and goes into the next release. |
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
Closes #247.
Fixes the streaming XML tool-call boundary for an empty string parameter. After the leading newline is removed, the remaining partial closing tag no longer includes the newline used by the previous hold-back pattern. The parser could therefore emit the closing tag text as the parameter value (
"</parameter") before the complete closing tag arrived.The hold-back now checks both forms of a possible closing-tag suffix: with the newline and without it. Non-empty values retain the existing newline-holding behavior.
Added a regression test for an
editcall with an emptynew_stringand a followingold_string. It verifies the parsed arguments and scans every byte prefix to ensure streamed argument JSON remains a prefix of the completed call.Checks
cargo test --lib partial_empty_string_parameter_does_not_leak_closing_tag: focused regression test.cargo test --lib partial_calls_are_prefixes: existing streaming-prefix coverage.git diff --check: passed.cargo fmt --all -- --checkreports broad pre-existing formatting drift across untouched files; no repository-wide reformat was applied.AI disclosure
Prepared with AI assistance (Little Code Sauce) and reviewed against
xml_partial,xml_value, and the existingpartial_calls_are_prefixestest. All commits include a DCO sign-off.