The llama.cpp project has introduced a dedicated parser for the Ling 3.0 (Bailing V3) chat template in pull request #28682. This change addresses issues where the model's pre-opened think blocks caused tool calls to be incorrectly classified as reasoning content, leading to failed agent loops.
The new parser terminates reasoning at either the closing think tag or the start of a tool call tag, mirroring behavior in vLLM and SGLang. It includes comprehensive tests for unclosed think blocks, parallel calls, and various argument types.
This update ensures that clients correctly receive tool calls instead of empty content, allowing agent loops to function properly with Ling 3.0 models.