Skip to content

chat : handle tool calls with no required args in TAG_WITH_TAGGED format#20764

Merged
pwilkin merged 2 commits intoggml-org:masterfrom
jpohhhh:fix-no-args-tool-call
Mar 19, 2026
Merged

chat : handle tool calls with no required args in TAG_WITH_TAGGED format#20764
pwilkin merged 2 commits intoggml-org:masterfrom
jpohhhh:fix-no-args-tool-call

Conversation

@jpohhhh
Copy link
Contributor

@jpohhhh jpohhhh commented Mar 19, 2026

regarding #20650

When a tool has no required args, the model may emit <tool_call>name</tool_call> with no arg tags. The grammar tried to peek ahead for an arg tag after the tool name, even when all args were optional, so the peek failed, and the tool call was not recognized.

@ggml-gh-bot
Copy link

ggml-gh-bot bot commented Mar 19, 2026

Hi @jpohhhh, thanks for your contribution!

Per our contribution guidelines, the automated PR checker found the following issue(s) that need your attention:

  • Multiple open PRs from a new contributor: We limit new contributors (those without a previously merged PR) to 1 open PR at a time. You currently have 3 open PRs.

Please note that maintainers reserve the right to make final decisions on PRs. If you believe there is a mistake, please comment below.

@github-actions github-actions bot added the testing Everything test related label Mar 19, 2026
Co-authored-by: Aldehir Rojas <hello@alde.dev>
@pwilkin pwilkin merged commit 76f2dc7 into ggml-org:master Mar 19, 2026
1 check passed
Ethan-a2 pushed a commit to Ethan-a2/llama.cpp that referenced this pull request Mar 20, 2026
…mat (ggml-org#20764)

* chat : handle tool calls with no required args in TAG_WITH_TAGGED format

* Update tests/test-chat.cpp [no ci]

Co-authored-by: Aldehir Rojas <hello@alde.dev>

---------

Co-authored-by: Piotr Wilkin (ilintar) <piotr.wilkin@syndatis.com>
Co-authored-by: Aldehir Rojas <hello@alde.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Everything test related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants