Repository navigation
serve: preserve literal </tool_call> in prompts - #2039
CC-David-CC wants to merge 1 commit into
Conversation
|
I have confirmed that it works properly on an IQ3_S/Windows/AMD configuration. (Successful 10 out of 10 times) |
|
Reproduced and fixed on our side:
Real tool calls still parse (our 3-call tool test passes: 3/3), and decode is unchanged (1 / 4 / 8 clients: 149 / 269 / 393 tok/s, against 144 / 268 / 392 without it). Rig: 4x RTX 5080 16 GB (PCIe Gen3), i9-10920X, 123 GiB RAM, Linux, CUDA sm_120. Qwen3.8-Flash-Next GSQ-RCO IQ3_S, |
|
teamwork makes the dream work |
|
For the record: we now run v0.1.43.1, which includes this fix (#2026 in the release notes). It reads the same on our rig: |
|
I have made a number of changes about tool calls this morning: the goal is to upstream to strata but it is EXPERIMENTAL !! meaning i didn't ask and made unilateral changes bbuuttt so come take whatever |
|
Same family reproduces for a different user-defined literal, on the released 0.1.43.1 build (no PR code): Rig: RTX 4090D 48 GB, Windows 11, IQ3_XXS native pack, engine 0.1.43.1 (release zip),
Raw shape of the failing one: I read our pack's Question: would you or the maintainer extend the literal protection to every USER_DEFINED literal? I noticed the generic form in the Public_Context_COW tree ( |
|
let me look into what it will take to implement before i commit to it |
|
For triage: #2026 is closed and main fixed it another way in v0.1.43.1: a683000 ("a quoted </tool_call> in a message is text, not the end-of-call token"), then 62185aa (the same for |
Title
serve: preserve literal
</tool_call>in promptsIssue: Resolves #2026
Summary
Asking the model to print
</tool_call>verbatim can produce an empty final response. The tokenizer treats this spelling as a user-defined special token even inside ordinary message text. Protecting it as plain text in the prompt makes the reported reproduction return the requested string.What changed
TOOL_LITERAL_TAGSwith one entry,</tool_call>, to the existing literal-span protection.This is a standalone fix against
main; it does not depend on #1886. No new state machine, retry, configuration option, or engine change is required. Prompts without the target literal retain identical token IDs.Extra Notes
Validation
The issue's exact prompt was run through the service with a real IQ3_XXS model on Linux/CUDA (RTX PRO 6000 Blackwell). Ten interleaved before/after pairs used seeds 42-51, temperature 0.6, top_p 0.95, top_k 20, thinking enabled, and no tools. Both arms used the PR code; the baseline restored the original literal registry. Raw input/output token IDs were captured.
</tool_call><|im_start|>responseThe
</aaa>and</mcp_tool>controls each passed before and after. The reporter's IQ3_S/Windows/AMD configuration was not tested.339 tests passed on the standalone PR branch (Windows, Python 3.13.15). Regression command (no model/GPU required):
Removing the new registry entry makes 20 prompt-protection subcases fail; restoring it passes them. Existing output parsing already preserves a standalone closer, so the production fix stays in prompt tokenization.