[GH-ISSUE #5282] [Engine] Empty <tool_call></tool_call> envelopes on tool-search/deferred tools (Q2_0 and IQ3_XXS) #3148

Open
opened 2026-11-07 14:38:27 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @mlaihk on GitHub (Nov 5, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5282

Environment

  • Strata: 0.1.56 (control/engine, Windows x86_64; current installed build)
  • Models: Qwen3.8-Flash-Next in Q2_0 and IQ3_XXS — both reproduce
  • Endpoint: OpenAI-compatible /v1/chat/completions, tools + tool_choice: "auto"
  • Client: OpenClaw 2026.10.8, main agent with 177 tools behind its compact/deferred tool directory
  • Comparison: the same Qwen3.8-Flash-Next model in LM Studio without MTP does not show this tool-call issue

Summary

When the model needs a tool that sits behind the client's deferred tool directory — i.e. the turn requires a tool_search discovery step — Strata returns literal empty <tool_call> blocks as assistant text instead of either structured tool_calls or a normal text answer.

The turn ends with finish_reason: "stop", no tool_calls array is present, and the client cannot execute anything. The agent session stalls.

Observed output

Exact assistant content from two separate runs:

<tool_call>
</tool_call>

and:

<tool_call>
</tool_call>
<tool_call>
</tool_call>
  • finish_reason: "stop"
  • no tool_calls
  • preceding reasoning correctly identified the intended tools:
    • first case: a memory search
    • second case: web_search / web_fetch

The blank tags are then delivered to the user as visible chat text.

Reproduction shape

  1. Use a client that presents a large tool catalog behind a tool_search discovery step (OpenClaw's compact directory, ~177 tools).

  2. Ask for something that requires a deferred tool, e.g.:

    search to see what movies are showing in Hong Kong over the coming weekends

  3. The model's reasoning says to use web_search / web_fetch.

  4. The response content is empty <tool_call> tags, finish_reason: "stop".

  5. No tool executes; the turn stalls.

Control observations

Direct /v1/chat/completions calls with a small declared tool list work normally:

  • get_weather → structured tool_calls with {"city":"Hong Kong"}, finish_reason: "tool_calls"
  • a directly declared tool_search function → structured tool_calls with 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

  • #4751 / #4071 describe non-empty <tool_call><function=...> blocks being returned as text.
  • #4663 (closed) covers a named tool that is absent from the current tools array.
  • This report is an empty envelope with no name and no arguments, reproduced across two quantizations, at the deferred-tool / tool-search boundary. Basic direct tool calls work.

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

  • Treat an empty <tool_call></tool_call> as an engine-level tool-call parse failure, not normal assistant text.
  • Either emit a structured tool_calls entry for the intended discovery tool, or return a clear error / finish_reason that lets the client retry.
  • If the parser requires a declared tool name, surface that as a structured rejection (not raw text), and include the intended name when available.
  • Please check whether this is already fixed in 0.2.10; the current installed build is 0.1.56.
Originally created by @mlaihk on GitHub (Nov 5, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/5282 ## Environment - **Strata:** 0.1.56 (control/engine, Windows x86_64; current installed build) - **Models:** `Qwen3.8-Flash-Next` in **Q2_0** and **IQ3_XXS** — both reproduce - **Endpoint:** OpenAI-compatible `/v1/chat/completions`, `tools` + `tool_choice: "auto"` - **Client:** OpenClaw 2026.10.8, main agent with **177 tools behind its compact/deferred tool directory** - **Comparison:** the same Qwen3.8-Flash-Next model in **LM Studio without MTP** does **not** show this tool-call issue ## Summary When the model needs a tool that sits behind the client's deferred tool directory — i.e. the turn requires a `tool_search` discovery step — Strata returns **literal empty `<tool_call>` blocks as assistant text** instead of either structured `tool_calls` or a normal text answer. The turn ends with `finish_reason: "stop"`, no `tool_calls` array is present, and the client cannot execute anything. The agent session stalls. ## Observed output Exact assistant content from two separate runs: ```text <tool_call> </tool_call> ``` and: ```text <tool_call> </tool_call> <tool_call> </tool_call> ``` - `finish_reason: "stop"` - no `tool_calls` - preceding reasoning correctly identified the intended tools: - first case: a memory search - second case: `web_search` / `web_fetch` The blank tags are then delivered to the user as visible chat text. ## Reproduction shape 1. Use a client that presents a large tool catalog behind a `tool_search` discovery step (OpenClaw's compact directory, ~177 tools). 2. Ask for something that requires a deferred tool, e.g.: > search to see what movies are showing in Hong Kong over the coming weekends 3. The model's reasoning says to use `web_search` / `web_fetch`. 4. The response content is empty `<tool_call>` tags, `finish_reason: "stop"`. 5. No tool executes; the turn stalls. ## Control observations Direct `/v1/chat/completions` calls with a **small declared tool list** work normally: - `get_weather` → structured `tool_calls` with `{"city":"Hong Kong"}`, `finish_reason: "tool_calls"` - a directly declared `tool_search` function → structured `tool_calls` with 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 - #4751 / #4071 describe **non-empty** `<tool_call><function=...>` blocks being returned as text. - #4663 (closed) covers a **named** tool that is absent from the current `tools` array. - This report is an **empty envelope with no name and no arguments**, reproduced across two quantizations, at the deferred-tool / tool-search boundary. Basic direct tool calls work. ## 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 - Treat an empty `<tool_call></tool_call>` as an engine-level tool-call parse failure, not normal assistant text. - Either emit a structured `tool_calls` entry for the intended discovery tool, or return a clear error / `finish_reason` that lets the client retry. - If the parser requires a declared tool name, surface that as a structured rejection (not raw text), and include the intended name when available. - Please check whether this is already fixed in `0.2.10`; the current installed build is `0.1.56`.
Author
Owner

@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:

arm (x2 each) shape result
177 tools declared directly your failing catalog size, named incl. web_search 4/4 structured tool_calls (run at 1500 budget; see the 256-budget note)
deferred directory + tool_search only the compact-catalog shape, discovery step declared 2/2 structured tool_search
small get_weather your control 2/2 structured (control confirmed)
web_search in history, absent from tools the #4663 discriminator 2/2 no raw XML, no empty tags - a normal stop or a text answer

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)

<!-- gh-comment-id:6654452593 --> @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: | arm (x2 each) | shape | result | | --- | --- | --- | | 177 tools declared directly | your failing catalog size, named incl. web_search | 4/4 structured tool_calls (run at 1500 budget; see the 256-budget note) | | deferred directory + tool_search only | the compact-catalog shape, discovery step declared | 2/2 structured tool_search | | small get_weather | your control | 2/2 structured (control confirmed) | | web_search in history, absent from tools | the #4663 discriminator | 2/2 no raw XML, no empty tags - a normal stop or a text answer | 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)
Author
Owner

@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:

  • Strata 0.2.10 (source at ffa80d73), Linux, not 0.1.56 / Windows
  • RTX 4060 Ti 16 GB main, MTP on (--spec 4 --mtp), 384K context with YaRN 1.5, --kv int8
  • Config sampling 1.0 / 0.95 / 20; the client (OpenMinis, /v1/messages) may send its own temperature, I did not capture it
  • A long agent session, not a fresh short prompt

It 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.

<!-- gh-comment-id:6657073931 --> @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: - Strata 0.2.10 (source at ffa80d73), Linux, not 0.1.56 / Windows - - RTX 4060 Ti 16 GB main, MTP on (`--spec 4 --mtp`), 384K context with YaRN 1.5, `--kv int8` - - Config sampling 1.0 / 0.95 / 20; the client (OpenMinis, `/v1/messages`) may send its own temperature, I did not capture it - - A long agent session, not a fresh short prompt - It 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.
Author
Owner

@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)

<!-- gh-comment-id:6659335179 --> @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)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3148
No description provided.