mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #5282] [Engine] Empty <tool_call></tool_call> envelopes on tool-search/deferred tools (Q2_0 and IQ3_XXS) #3148
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#3148
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 @mlaihk on GitHub (Nov 5, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5282
Environment
Qwen3.8-Flash-Nextin Q2_0 and IQ3_XXS — both reproduce/v1/chat/completions,tools+tool_choice: "auto"Summary
When the model needs a tool that sits behind the client's deferred tool directory — i.e. the turn requires a
tool_searchdiscovery step — Strata returns literal empty<tool_call>blocks as assistant text instead of either structuredtool_callsor a normal text answer.The turn ends with
finish_reason: "stop", notool_callsarray is present, and the client cannot execute anything. The agent session stalls.Observed output
Exact assistant content from two separate runs:
and:
finish_reason: "stop"tool_callsweb_search/web_fetchThe blank tags are then delivered to the user as visible chat text.
Reproduction shape
Use a client that presents a large tool catalog behind a
tool_searchdiscovery step (OpenClaw's compact directory, ~177 tools).Ask for something that requires a deferred tool, e.g.:
The model's reasoning says to use
web_search/web_fetch.The response content is empty
<tool_call>tags,finish_reason: "stop".No tool executes; the turn stalls.
Control observations
Direct
/v1/chat/completionscalls with a small declared tool list work normally:get_weather→ structuredtool_callswith{"city":"Hong Kong"},finish_reason: "tool_calls"tool_searchfunction → structuredtool_callswith a query,finish_reason: "tool_calls"So basic OpenAI tool calling is functional. The failure appears when the tool is not directly declared and the client expects a discovery/search step, or when the catalog is large/deferred.
Why this appears distinct from existing issues
<tool_call><function=...>blocks being returned as text.toolsarray.Impact
The client cannot recover: there is no structured call and no text answer, and the turn stops. In OpenClaw the empty tags are delivered to the chat as a blank tool-call message, so the user sees a malformed response rather than a retryable error.
Ask
<tool_call></tool_call>as an engine-level tool-call parse failure, not normal assistant text.tool_callsentry for the intended discovery tool, or return a clear error /finish_reasonthat lets the client retry.0.2.10; the current installed build is0.1.56.@udqe commented on GitHub (Nov 5, 2026):
A third row that does not reproduce, with a narrowing clue inside it. Same engine build as the report (0.1.56, Windows), MTP drafting on, T=0, our quant the UD-Q4_K_XL full pack - versus your two reproducing quants (Q2_0, IQ3_XXS). We asked the deferred-tool boundary directly, ten times across four shapes, and never saw an empty envelope:
Ten requests, zero
<tool_call>text, on the build where you reproduce. What your report and this table share: the two quants that reproduce are both heavily compressed, and the one that does not is a full-size pack. If a parser gap were the mechanism, the quant should not matter - so this smells like the model-side generation family (#5276's misspelled opening tag is the same species: the model emits the envelope's text without committing to its contents, and at higher compression the commitment fails first). That is a hypothesis from one row of negative evidence, not a finding; it is yours or the maintainers' to test on the reproducing quants.Two observations from our side of the boundary, offered because they hit the same user-visible symptom. First, at max_tokens 256 the same 177-tool prompt burned the whole budget inside reasoning and returned content='' with finish_reason "stop-class length" - an empty assistant message reaching the client, no tags involved. An agent client that surfaces blanks would show that as a near-identical stall to yours; worth distinguishing yours from it by the finish_reason when you next capture a failing turn. Second, we cannot isolate MTP from your post: the LM Studio contrast changes the whole stack, not just drafting, and our non-reproduction is MTP-on. If a maintainer wants an MTP-off arm from a box where the shape otherwise works, that is a restart here and we will run it.
Caveats, plainly: our client is a synthetic approximation of the OpenClaw shape (37 named deferred tools + 140 util_NNN entries + a discovery instruction in the system prompt), not OpenClaw itself, and the user turn was yours verbatim; n=2 per arm at T=0; this is one box, one prompt content. Nothing above needed a config change on our side.
(ai-assisted; request-level probes on our box; matrix and arms pinned in our notes)
@abram1984 commented on GitHub (Nov 5, 2026):
One data point against the "only heavily compressed quants" idea: the misspelled opening tag in #5276 happened on UD-Q4_K_XL (the unsloth 4-part pack, IQ4_NL n-gram table), not on a Q2/IQ3 quant.
Setup, for comparison with the table above:
ffa80d73), Linux, not 0.1.56 / Windows--spec 4 --mtp), 384K context with YaRN 1.5,--kv int8/v1/messages) may send its own temperature, I did not capture itIt was a single event and I can't trigger it at will, so it doesn't prove a parser gap either. But it means the quant is not the whole story: a full-size pack can produce the envelope as text too, at least in a long session through the Anthropic endpoint.
@udqe commented on GitHub (Nov 5, 2026):
Your data point lands, and it moves our hypothesis - so let us split the claim we made in two, because it was really two claims stapled together, and only one of yours breaks.
What you broke: that higher compression is where this family lives. A full-size UD-Q4_K_XL pack, on a different OS, a different endpoint and a long session, produced an envelope as text - so "quant is the gate" is dead from your single event and our zero rows together. At best quant size is an amplifier, not a door: your session makes that the honest ceiling for our reading.
What your event does not speak to, through no fault of it: the envelope in your #5276 is misspelled but COMPLETE - it carries the function name, the parameters, a tooltitle block, and closes with a proper underscore tag. The envelope in this issue is EMPTY - no name, no arguments, just the opening and closing tags back to back. Those look like different ways for the same commitment to fail: yours wrote the call's contents but misspelled the opening token; this one apparently reserved the envelope and never produced the contents. Our "small quants reproduce" line was about the empty form only, and your pack does not test that form - so the empty form stays unfalsified, but also, as you say, unproven by us. Three rows, three shapes, no shared variable yet: misspelled-complete (full pack, long session, default sampling, Anthropic endpoint), empty (two small quants, one client, T unknown), and the closed named-but-undeclared class (#4663, gone on this generation).
If it helps triage keep them apart: the client-visible symptom is identical for all three - a stalled turn with no tool_calls and no text - and right now the only thing that distinguishes them is the raw content string. Capturing that string per report (yours did, which is why this exchange was possible; the temperature you could not capture is noted and is exactly the axis where you and we differ: our ten requests were fresh short prompts at T=0, your event was hours into an agent session) is the difference between three bugs and one bug with three faces. We have nothing more to add from our box on this build; if the empty form ever appears at full size anywhere, the narrowing dies completely and the session-length axis inherits the case.
(ai-assisted; our ten-arm matrix and this reply's claims pinned in our notes)