mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
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#3831
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/2057
Author: @psqq
Created: 10/12/2026
Status: ❌ Closed
Base:
main← Head:f-1666-stream-all-tool-args📝 Commits (2)
e8f12eeserve: an opt-in "stream_all_tool_args" sends a tool call's non-string argument in pieces as the model writes it4506d64serve: stream_all_tool_args streams only a value that is JSON text; the rest goes out quoted as before📊 Changes
5 files changed (+331 additions, -25 deletions)
View changed files
📝
docs/DETAILS.md(+26 -7)📝
serve/frontend.py(+64 -17)📝
serve/runconfig.py(+2 -0)📝
serve/server.py(+7 -1)➕
serve/test_tool_args_stream.py(+232 -0)📄 Description
Resolves #1666 (the keep-alive that already covers the idle timeout is in main as
14b9dd2e; this is theother half: the argument itself stops being silence)
Summary
A tool-call parameter whose declared type is not a string - an array, an object, a number - is held until
</parameter>and goes out as onetool_argspiece, so an app that shows the arguments as they arrive sits on{"edits":for minutes and then shows the finished call at once."stream_all_tool_args": trueinstrata-<model>.jsonsends that text as it is written, the way a string parameter already does. Off by default.What changed
serve/frontend.py:OutputParsergainsstream_all_args. In therawstate the value's JSON text passesthrough as it arrives, holding back a possible partial
</parameter>(the same_holdthestrstate uses) and acandidate end whose follower has not arrived yet, so #210 still holds: a
</parameter>inside the value stays partof the value. When the parameter ends, only what has not gone out yet is sent.
_close_scancloses a call cutinside such a value with the rest of that text, not with a JSON string of it.
serve/server.py: the config keystream_all_tool_args(must be true or false) reaches the parser.serve/runconfig.py: the key is editable from the About tab's Model settings card.docs/DETAILS.md: a bullet with the measurements; the streaming bullet now says a non-string parameter waits forits end unless the switch is on.
serve/test_tool_args_stream.py: 8 cases.What it leaves alone: without the key the stream is byte-identical to before; string parameters are untouched; the
final
tool_callof a call that was streamed is still not sent again, so the pieces a client joins are thearguments; the value is still parsed and checked at the end, so a broken argument is still the error it was. With it
on, what the model wrote is what goes out, so the whitespace is no longer normalized.
Extra Notes
Parser, an
editcall whoseeditsis an array of two objects (217 characters), fed at a token width of 8: 15argument pieces with one of 217 without the switch, 44 pieces with none longer than 9 with it. End to end over
/v1/chat/completionswithMockEngine(one token per step): 17 argument deltas, largest 247 characters, withoutthe switch; 263 deltas, largest 8, with it;
finish_reason: tool_callsand the joined pieces equal to the reportedarguments in both cases. On a real agent turn (Qwen3.8 Flash-Next IQ3_S, an
editcall with two edits): 27 argumentdeltas, 26 of them carrying 78 characters in all and one carrying 3,145 - 97% of the arguments in a single piece.
Checked with
python -m unittest serve.test_tool_args_stream serve.test_parser_track serve.test_reasoning_tools serve.test_reasoning_rescue serve.test_frontend serve.test_runconfig serve.test_structured(87 tests, OK) andserve.test_server(291 tests; the only errors are the three that import theregexmodule, the same on anunmodified tree). Not tested: Windows and AMD paths beyond their suites.
🤖 Fully generated by an LLM (qwen3.8-flash-next-iq3_s)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.