mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #843] Tool calls silently dropped in agent sessions after an empty assistant turn (fix: skip empty assistant turns when rendering) #375
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#375
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 @jramirez-uab on GitHub (Oct 4, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/843
Summary
With opencode as the client, Strata sometimes returns an empty assistant turn (no text, no tool call) when the user asks for an
action. Once one such turn is in the history, the model imitates it: later turns close the reasoning and end with
</think>\n\n<|im_end|>without emitting the<tool_call>. The client receives an empty answer and the agent "stops".Skipping empty assistant turns from the history in
serve/frontend.py(render) fixes it in our tests: 0-6/20 → 20/20.Environment
qwenIQ3_S (GSQ-RCO) andswiftIQ3_XXS; 262,144 context, KV int8, images on, default MTP settings.stream: false,reasoning_effort: xhigh,at temperature 1.0 (none sent) and 0.3.
How to reproduce
A multi-turn conversation whose history contains assistant turns with empty
contentand notool_calls(onlyreasoning_content),e.g. the user asked "haz un ls" three times and each assistant turn came back empty, then a fourth "haz un ls".
With
STRATA_DEBUG=1the raw model text of the failing answers is:i.e. the model never writes the tool call; the parser is not at fault.
Results (20 tries per case)
Things we ruled out: the chat template (it is Qwen's original plus Unsloth's fixes), the tool-call parser (the call is never generated),
--prompt-cache 0(worse: 0/5),--no-coupled-draft(no consistent change),preserve_thinking: false(still 6/20).Patch
The last message is never removed. An environment variable (
STRATA_KEEP_EMPTY_TURNS=1) keeps the old behaviour; feel free to make ita config option instead.
Related
<think>; here it never writes it.--gpus 0,1and"parallel": 2we also hit the engine exit reported in #776(
captured the batch window over slots 0) on 2× L40S; one GPU withparallel2, or two GPUs withparallel1, work.Thanks for Strata: on a single L40S the prompt speed stays flat (~4,300 tok/s) all the way to 198K tokens.
@talisp commented on GitHub (Oct 5, 2026):
One likely source of those empty assistant turns, seen here on the same kind of box (L40S 48 GB, 251 GB RAM, Qwen3.8-Flash-Next IQ3_S): the model writes a complete
<tool_call>inside the thinking, without</think>first (#804). The server then returns it asreasoning_content, with notool_callsand emptycontent. The client stores an assistant turn with nothing in it, and, as you found, the model then imitates that turn.We measured 4 such replies in ~1,050 (Hermes Agent); another user reported 13 in ~1,300 (#804). The fix for the stranded call is in #525 (opt-in
format_fixes). If you can logreasoning_contentof the empty turns in your 0–6/20 runs, a<tool_call>at the end of it would confirm the link.Also relevant (opinion): clients that drop
reasoning_contentfrom the history make every earlier turn render as an empty<think>\n\n</think>block (withpreserve_thinking). Some template authors call that "empty think poisoning". Your skip-empty-turns fix and #886 address the fully empty case.@Niko1221 commented on GitHub (Oct 6, 2026):
Fixed in 0.1.40: empty assistant turns no longer teach the model to answer with nothing (#886). STRATA_KEEP_EMPTY_TURNS=1 restores the old rendering.