]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
chat : fix muse-glimmer detection of tool calls after EOM (#26879)
authorruanslv <redacted>
Tue, 11 Aug 2026 20:15:20 +0000 (16:15 -0400)
committerGitHub <redacted>
Tue, 11 Aug 2026 20:15:20 +0000 (15:15 -0500)
commit0b1bad14ff204627636aeb1de22ddcd5acb859d4
tree240c58a8dbb2f7786077e71fb792925e0295fbfa
parent7b13a8404d7e219c13d1a243e2a21a857a6e99d9
chat : fix muse-glimmer detection of tool calls after EOM (#26879)

* chat : fix muse-glimmer swallowing a trailing tool call into content

Muse Glimmer routinely answers the user and calls a tool in a single
generation. The template terminates a message with <|eom|> when more
messages follow in the same turn and <|eot|> only at the end of the turn,
so the answer is closed by <|eom|> and the call opens a fresh header:

    <prose><|eom|><|start|>assistant to=<tool><|message|><atem:function_calls>...

The final-message rule read content with until("<|eot|>"), which assumed the
user-facing message is always last. There is no <|eot|> before the call, so
content ran to the end of the turn, absorbed the markup, and no tool_calls
were emitted - the tool never ran. On a tau2-bench telecom run this hit 43
turns across 19 of 114 tasks.

Stop the answer at <|eom|> and parse what follows as tool calls.

Adds models/templates/muse-glimmer.jinja and four parser tests: a plain
answer, the <|eom|> junction, markup quoted in an answer staying content,
and tool markup inside the to=self channel staying reasoning.

* address comment
common/chat.cpp
models/templates/muse-glimmer.jinja [new file with mode: 0644]
tests/test-chat.cpp