mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #1666] Send a keep-alive while a tool call's array/object argument is being generated #669
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#669
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 @Efs-O on GitHub (Oct 9, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1666
Problem
With
stream_tools,OutputParserstreams string parameters piece by piece but holds every other type (arrays,objects) until
</parameter>(serve/frontend.py, the comment atstream_tools). The SSEpingis only sent when theengine yields
None(quiet) or during an MCP tool run. So while the model writes a large array argument — e.g. anedit_filecall whoseeditsis a list of 30-40 replacements — tokens are generated at full speed but nothing goes tothe client for minutes.
Clients with an idle timeout end the request. Forge's is 120 s; we hit it in a real agent turn: Strata generated
13.9K tokens, and the ~10K after the reasoning (the tool call) never reached the client.
Reproduction (v0.1.41, Qwen3.8 Flash-Next IQ3_S, 2 GPUs)
A streamed
/v1/chat/completionswith one tool whose argument is an array of objects, prompted to make 30 edits:finish_reason: tool_callsMeanwhile
/slotsis_processingand/v1/statusbusy/generatedshow the request is alive the whole time, so aclient can poll, but a keep-alive on the stream itself fixes every client at once.
Suggested fix (
serve/server.py, +12 lines, patch below)KEEPALIVE_S = 10.0.Service.run's token loop, remember when anything was last sent (last_out: set on the heartbeat ping and whenthe parser emits events). When a token produces no event and nothing has gone out for
KEEPALIVE_S, yield the same"ping"the heartbeat yields. No new event type; clients already ignore SSE comments.Tested
servesuite on v0.1.41 + the patch: 625 tests, 1 failure (test_slots...test_relative_save_dir_becomes_absolute),which fails identically on plain v0.1.41 on this machine (a TEMP 8.3 short-path issue, unrelated).
edit_filecall carried 66 KB ofarguments, with no stall.
Not done: a unit test for the ping cadence (needs a fake generator yielding tokens with no events for >10 s; I can
add one with a patched clock if you want it).
Patch (against v0.1.41)
🤖 Generated with Claude Code
@Niko1221 commented on GitHub (Oct 13, 2026):
Thanks for the report. To keep the tracker current we are closing issues older than three days: 0.1.44 is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1.
If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.