Files
llama.cpp/tools
Kyozzz 1729ed5371 server : reject prefilled assistant messages with tool calls (#27626)
* server: fix tool calls getting silently stripped with --prefill-assistant

Last assistant carries tool_calls + --prefill-assistant is on → request
flips into continuation mode, add_generation_prompt forced off, tail
rebuilt from reasoning_content + content only. Tool calls just vanish.

- Auto-continuation now skips trailing assistant msgs that have tool calls
- continue_final_message on those throws a clear error instead of
  silently corrupting the prompt
- Regression tests included, red before / green after

Fixes #27588

Developed with AI assistance, disclosed per the contribution policy.

* server : address review: fail on prefill-assistant + trailing tool_calls

Move validation into oaicompat_chat_params_parse (next to the existing
two-or-more-assistant check) and remove it from common_chat_templates_apply,
which has no precedent for validation. Drop the regression tests.

Per review: --prefill-assistant with a trailing assistant message
containing tool calls is not supported and should fail loudly.
2026-08-25 09:35:22 -05:00
..
2026-08-25 14:34:34 +02:00