mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4702] [Engine] Tool call parsing: an inner ``` fence closes a four-backtick fence, so a quoted example inside it becomes a call #2151
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#2151
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/4702
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 and on).An answer that hands the user a Markdown file in a four-backtick fence, with an inner three-backtick block that shows a
tool call, gets a real
readcall out of the example. The inner ``` closes the outer fence in the parser's codetracking; in CommonMark a fence is only closed by a fence of at least as many backticks.
Notes: tracking the opening fence's length (and character, ``` vs ~~~) and closing it only on a line of at least as many
of the same character would follow CommonMark.
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: no call, and the whole text as the answer.
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):
Fixed in 0.2.9: a call shown inside a longer code fence is now text and isn't run. A fence closes only with the same length it opened with. The indented case in #4703 is fixed too. Thanks for the exact write-ups.