llama.cpp b12253:修复工具参数控制字符转义
原标题:b12253
AI 摘要
llama.cpp 发布 b12253 版本,修复了 common 模块中工具调用参数字符串的控制字符转义问题。此前 normalize_quotes_to_json 在将 Python 风格工具参数转换为 JSON 时会原样保留原始控制字符,导致返回给客户端的 arguments 成为非法 JSON,历史回放会直接失败;现在通过 escape_json_string_inner 对引号字符串内的 C0 控制字符进行转义。该版本同时提供 macOS、Linux、Windows、Android 等多平台及各后端(CUDA、Vulkan、ROCm、SYCL、OpenVINO 等)的预编译包。
正文节选
<details open> common : escape control characters in tool argument strings (#31937) normalize_quotes_to_json copies raw control characters verbatim while converting pythonic tool arguments to JSON, so calls like python(code='a<LF>b') produce invalid JSON in the arguments returned to clients; replaying that history then fails hard. Escape C0 control characters inside quoted strings via escape_json_string_inner. </details> **Website:** - <https://llama.app> **Attestations:** - <https://github