common : avoid logging partial messages (which can contain broken UTF-8 sequences) (#14937)

* bug-fix: don't attempt to log partial parsed messages to avoid crash due to unfinished UTF-8 sequences
This commit is contained in:
kallewoof 2025-07-30 00:05:38 +09:00 committed by GitHub
parent 204f2cf168
commit 1a67fcc306
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -1944,6 +1944,8 @@ common_chat_msg common_chat_parse(const std::string & input, bool is_partial, co
}
}
auto msg = builder.result();
if (!is_partial) {
LOG_DBG("Parsed message: %s\n", common_chat_msgs_to_json_oaicompat<json>({msg}).at(0).dump().c_str());
}
return msg;
}