mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2039] [CLOSED] serve: preserve literal </tool_call> in prompts #3820
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#3820
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/2039
Author: @CC-David-CC
Created: 10/12/2026
Status: ❌ Closed
Base:
main← Head:fix/2026-literal-tool-call-output📝 Commits (1)
fcb4190fix(serve): preserve literal tool-call closers in prompts📊 Changes
2 files changed (+202 additions, -4 deletions)
View changed files
📝
serve/frontend.py(+6 -4)➕
serve/test_literal_tool_tags.py(+196 -0)📄 Description
Title
serve: preserve literal
</tool_call>in promptsIssue: Resolves https://github.com/Niko1221/Strata/issues/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.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
STRATA_SELECT_LONG=1, opt-in, GP100 builds) #4793STRATA_PREFILL_PIPE_FLOOR, the smallest pipelined prompt chunk (default 512, as before) #4794