jinja: the caps probe hands the template an empty tools array, not [null] -- GLM-5.3's template iterated it and lost string content

json{nullptr} is the one-element array [null], not an empty one. The string-content probe
passed it as `tools`; GLM-5.3's template iterates `tools` under `{% if tools %}`, so the probe's
render threw on the null element, the throw was taken for "cannot render string content", and
with typed content unsupported as well every request logged `render_message_to_json: Neither
string content nor typed content is supported`. llama.cpp master passes json::array() (PR
#27130); so does this probe now. The GLM-shaped template in chat_test asserts string content.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
NunzeandClaude Fable 5.1 authored and StillDeadcode committed 2026-10-21 09:42:27 +02:00
1 parent 459529638e
commit d2a165d56d
2 files changed
+7 -2

No files matched your search

+3
View File
@@ -1032,6 +1032,9 @@ TEST(a_dotted_integer_is_an_index_as_in_jinja2) {
"{%- if add_generation_prompt %}<assistant>{% endif %}", "", ""));
CHECK(glm.caps().tools);
CHECK(glm.caps().tool_calls);
/* The string-content probe hands the template an empty tools array, not [null]: this
* template iterates `tools`, threw on the null, and lost string content. */
CHECK(glm.caps().string_content);
ChatTemplate first;
CHECK_OK(first.load("{{ messages.0.content }}|{{ messages.1.role }}", "", ""));