chat: tagged calls whose name the opener opens -- GLM-5's <tool_call>NAME<arg_key>

GLM-5 writes <tool_call>NAME<arg_key>K</arg_key><arg_value>V</arg_value>...</tool_call>: no
prefix of the name's own and no suffix, the name ends at the first argument or at the call's
close. The tagged family now takes an empty name_suffix when name_prefix opens the call (no
call_open): the derivation from the template makes the per-call opener the prefix and its closer
call_end, the grammar takes eps() for the suffix, and the streaming parser finds the name's end
byte by byte (name_stop, name_plausible) and reads the closing tag as the first item of the
body. arg_name_suffix and arg_value_prefix may both be set and are read back to back, so
chat_format_markers keeps both tags. value_newlines comes from a probe render of the template
rather than a constant (GLM and MiniCPM false, Qwen true). The ABI struct is unchanged; its
comments say what an empty name_suffix means now.

chatparse_test: GLM's template serves tools; the derived format equals the one a plugin would
declare; every rendered reply in the corpus reads back as the message it rendered, split at
every byte; and replies that stray from the grammar. Each fails without this change. The Gemma
refusal names call_end.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
NunzeandClaude Opus 5.5 authored and Claude Code (srv-dev01) committed 2026-10-19 15:34:15 +02:00
1 parent 5ac0bc9690
commit e60810116c
6 files changed
+507 -22

No files matched your search

+1 -1
View File
@@ -196,7 +196,7 @@ TEST(an_older_struct_reads_the_object_fields_as_zero) {
CHECK(!f.object_bare_keys);
CHECK(!f.reasoning_anywhere);
CHECK(chat_format_check(f, &why) == RAD_E_UNSUPPORTED);
CHECK(why.find("name_suffix") != std::string::npos);
CHECK(why.find("call_end") != std::string::npos);
}
TEST(an_object_format_the_parser_cannot_read_is_refused_by_name) {