]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
common : fix improper trimming in XML parser on complete message (#19805)
authorAldehir Rojas <redacted>
Sun, 22 Feb 2026 16:34:54 +0000 (10:34 -0600)
committerGitHub <redacted>
Sun, 22 Feb 2026 16:34:54 +0000 (17:34 +0100)
Co-authored-by: Jules LEIDELINGER <redacted>
common/chat-parser-xml-toolcall.cpp

index a80900ff8d848a233e5f4a18fc81c7df0c493026..ba359fdbf46ad33204b2439000009edbc44509f9 100644 (file)
@@ -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);