Repository navigation
serve: preserve Markdown state across skipped tool-call newlines - #1362
Closed
hawkli-1994 wants to merge 1 commit into
Closed
hawkli-1994 wants to merge 1 commit into
hawkli-1994 wants to merge 1 commit into
Conversation
Advance the existing Markdown state before discarding leading newlines so a fenced example after a real call stays text and later real calls still parse. Cover both fence delimiters, every two-way split, streaming arguments, and all three HTTP APIs without adding new recovery rules.
fragtion
pushed a commit
to fragtion/StrataPool
that referenced
this pull request
Oct 7, 2026
…ool calls serve: track skipped newlines after tool calls Advance the existing Markdown state before discarding leading newlines so a fenced example after a real call stays text and later real calls still parse. Cover both fence delimiters, every two-way split, streaming arguments, and all three HTTP APIs without adding new recovery rules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0157fjixQD2nRxvCvtXq66DD
DarthCY-K
added a commit
to DarthCY-K/Strata
that referenced
this pull request
Oct 9, 2026
|
Still reproduces on current main (296b59d, v0.1.44.1): with this PR's |
DarthCY-K
added a commit
to DarthCY-K/Strata
that referenced
this pull request
Oct 19, 2026
…e (v0.1.45 + Niko1221#1362 + /v1/models context_window); upstream absorbed Niko1221#1107/Niko1221#1367/Niko1221#1548
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 82f46a8 with 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.