mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1362] [CLOSED] serve: preserve Markdown state across skipped tool-call newlines #3407
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#3407
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/1362
Author: @hawkli-1994
Created: 10/7/2026
Status: ❌ Closed
Base:
main← Head:fix/tool-call-newline-markdown-state📝 Commits (1)
17412c5serve: track skipped newlines after tool calls📊 Changes
2 files changed (+32 additions, -0 deletions)
View changed files
📝
serve/frontend.py(+2 -0)📝
serve/test_reasoning_rescue.py(+30 -0)📄 Description
Summary
After a real tool call, OutputParser discards leading newlines without advancing its Markdown state. When prose precedes the call, the next code fence is tracked as part of that stale line. A tilde-fenced example can then become an extra tool call, while a backtick fence can hide a later real call.
Track the skipped newlines before discarding them so fenced examples stay text and subsequent real calls still parse.
What changed
Extra Notes
Validation on the original base
82f46a8with this patch, using Python 3.12.14 on Linux:HTTP checks use MockEngine and ByteTokenizer. GPU execution, model-backed generation, and a real pack tokenizer were not tested. The passing full-suite run used an isolated environment without psutil. A separate run with psutil hit an existing AmdTelemetry.test_readings error when the container returned None for disk I/O counters; this also reproduced with unchanged upstream telemetry code.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.