From: Piotr Wilkin (ilintar) Date: Mon, 15 Jun 2026 15:33:54 +0000 (+0200) Subject: chat: include full unparsed prompt in debug (#24650) X-Git-Tag: upstream/0.0.10438~780 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=38d546330ad3de1c6d318a2de912c860c53ac8c0;p=pkg%2Fggml%2Fsources%2Fllama.cpp chat: include full unparsed prompt in debug (#24650) message on parse error --- diff --git a/common/chat.cpp b/common/chat.cpp index 05c2e85be..ded8440e6 100644 --- a/common/chat.cpp +++ b/common/chat.cpp @@ -2678,10 +2678,9 @@ common_chat_msg common_chat_peg_parse(const common_peg_arena & src_pars } return msg; } - LOG_WRN("%s: unparsed %s output: %s\n", __func__, common_chat_format_name(params.format), - effective_input.substr(result.end).c_str()); - throw std::runtime_error(std::string("The model produced output that does not match the expected ") + - common_chat_format_name(params.format) + " format"); + LOG_WRN("%s: unparsed %s output: %s\n", __func__, common_chat_format_name(params.format), effective_input.substr(result.end).c_str()); + LOG_DBG("%s: full %s output triggering error:\n=== BEGIN ===\n%s\n=== END ===\n", __func__, common_chat_format_name(params.format), effective_input.c_str()); + throw std::runtime_error(std::string("The model produced output that does not match the expected ") + common_chat_format_name(params.format) + " format"); } common_chat_msg msg;