mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4701] [Engine] Tool call: a file write whose content lists the closing tags on their own lines is cut short, and the rest leaks into the answer #2149
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#2149
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?
Originally created by @KarlGrier on GitHub (Oct 30, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4701
Area
[Engine] (speed, kernels, models, the server and API)
Desktop app, Terminal or source?
Source (START-HERE.bat, setup.sh or a build)
What happened
In
serve/frontend.py'sOutputParserat v0.2.8 (recover off; the same with recover on and with streamed arguments).A real
write_filecall whosecontentis a document that explains the call format - with</parameter>,</function>and</tool_call>each on a line of its own inside the value - comes back with its content cut at thefirst
</parameter>line. The rest of the file, followed by the real closing tags, is sent as visible answer text. Thefile the client writes is silently truncated.
Notes:
closing sequence followed by more text is not covered yet.
<parameter=/</function>/</tool_call>and then the end of the output or another call). Here the text afterthe first
</parameter>is prose, so the value is still open.Smallest steps or command that reproduce it
Parser level - no model, no GPU, no server. From the root of a v0.2.8 checkout, with this setup:
then:
Observed (the same whole, byte by byte, and in pieces of 7):
Expected: one
write_filecall whosecontentis the whole document; no answer text after the call.Reproduction status
Reproduced locally
Strata version
v0.2.8 (the tag, source checkout, no local modifications) · engine 0.1.54
Graphics card, memory and system
Not involved (parser level, no GPU) · Linux · Python 3.12
Model, size and settings
Not involved: the parser is fed the model's text directly (the Qwen3.8-Flash-Next call form from serve/test_tool_corpus.py).
Measured and drafted with Claude Code.
@Niko1221 commented on GitHub (Oct 31, 2026):
This isn't in 0.2.9. A fix is ready for the next update, 0.2.9.1: a finished call waits for the end of the answer, a second call or about 1,500 more characters before it's handed over, so a file that lists the closing tags is written whole. Its server tests pass. Keeping this open until it ships.
@LispEngineer commented on GitHub (Nov 5, 2026):
Additional Linux hardware evidence for #4701 and #5040. The complete-text parser check passes on v0.2.11, but this live IQ3_S case ends in the model output before the full requested file is generated. I am not reporting it as a new parser regression.
Environment
c62d5e3a15; v0.2.11 / engine 0.1.57, commitc3b3f50355.Observed sequence
The actual prompt follows. Only the absolute destination pathname is replaced by for privacy; this placeholder was not the pathname used in the run.
Expected: the 141-byte file, including the sentence and final sentinel.
Actual: the write tool receives a 48-byte prefix, ending at
Literal closing tags:, and writes those 48 bytes.The paired v0.2.9 and v0.2.11 captures contain identical full API request bodies and identical raw model output. Each paired arm was run once; I am not claiming a measured reproduction rate. The raw model text below is present before API parsing (same pathname substitution):
The model has already closed its call and emitted <|im_end|> without the requested trailing sentence/sentinel. Reconstructing the streamed API arguments gives the same 48-byte content as the file. This capture does not show the server dropping text the model generated.
Checks and limits
Is there a supported escaping or tool-call representation for writing this literal closing-tag sequence reliably? I can provide the bounded, sanitized request/stream comparison if helpful. I have kept it separate from the parser fix because the raw model capture changes the diagnosis.
@Niko1221 commented on GitHub (Nov 6, 2026):
Fixed in 0.2.11: a file write whose content lists closing tags on their own lines now arrives in full, streamed or not. Could you check on 0.2.11? I'll close this once you confirm.
@Tsury commented on GitHub (Nov 7, 2026):
Checked with the reproduction above, unchanged, on
serve/from v0.2.11 (c3b3f50) and v0.2.12 (146df3c4): onewrite_filecall whosecontentequalsDOCbyte for byte, and the answer is only "I will save the doc." on both. We carry no local parser patch for this since 0.2.10.