From: Aldehir Rojas Date: Sun, 22 Feb 2026 16:34:54 +0000 (-0600) Subject: common : fix improper trimming in XML parser on complete message (#19805) X-Git-Tag: gguf-v0.18.0~44 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=ed4837891d3a142d8806c3879afb5752f1254e98;p=pkg%2Fggml%2Fsources%2Fllama.cpp common : fix improper trimming in XML parser on complete message (#19805) Co-authored-by: Jules LEIDELINGER --- diff --git a/common/chat-parser-xml-toolcall.cpp b/common/chat-parser-xml-toolcall.cpp index a80900ff8..ba359fdbf 100644 --- a/common/chat-parser-xml-toolcall.cpp +++ b/common/chat-parser-xml-toolcall.cpp @@ -803,7 +803,7 @@ inline void parse_msg_with_xml_tool_calls(common_chat_msg_parser & builder, cons } // remove potential partial suffix - if (builder.pos() == builder.input().size()) { + if (builder.pos() == builder.input().size() && builder.is_partial()) { if (unclosed_reasoning_content.empty()) { rstrip(content); trim_potential_partial_word(content);