[GH-ISSUE #5409] [Engine] serve: accept tools <name> (space) and a bare tools as a declared tool's name, next to #4751's tools.<name> #3232

Closed
opened 2026-11-07 14:39:02 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @ludiazv on GitHub (Nov 6, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5409

What happens

With a harness that also offers a code-mode tool (the model writes JavaScript that calls the other tools as
tools.<name>(...)), Qwen3.8-Flash-Next sometimes carries that spelling into a native call's function name, with
a space instead of the dot, or the bare prefix alone:

<tool_call>
<function=tools actio>
<parameter=command>
...
</parameter>
</function>
</tool_call>
<tool_call>
<function=tools>
<parameter=command>
...
</parameter>
</function>
</tool_call>

The declared tool is actio (parameters include command). Neither name matches a declared tool or one of the
aliases in OutputParser.__init__ (serve/frontend.py, the #4751 block: tools., functions., default_api. +
name), so the block is returned as answer text and the turn ends (finish_reason: stop). The harness (Pi) shows the
raw block instead of running the call, and the agent stalls until the user intervenes.

Setup

  • Strata v0.2.10 (Control / engine 0.1.56), Linux, one RTX 3090 + RAM experts, Qwen3.8-Flash-Next ISTA-DASLab GSQ-RCO
    IQ3_S, MTP drafter, default tool_call_recovery (on). The alias rule is the same in v0.2.11 and on main.
  • Harness: Pi (pi/1.x) through an OpenAI-compatible proxy (llama-swap), Chat Completions with tools. Declared
    tools: read, bash, write, edit, codemode, actio, budget. codemode runs JavaScript in which the other
    tools are tools.read(...), tools.actio(...), etc.

How often

One long agent session (494 assistant turns, all Flash-Next): 516 tool calls parsed correctly (158 of them codemode),
2 returned as text: one <function=tools>, one <function=tools actio>. Both came during code-mode work; the
second directly followed a codemode call that used tools.actio(...) (it failed on a parameter error, and the model
then tried a native call to inspect the tool).

Expected

The same unambiguous-alias rule as #4751, extended to the spellings Qwen produced here:

  1. <prefix> <name> with a space, for the existing prefixes (tools, functions, default_api): an alias of
    <name> when exactly one declared tool has that name. This one seems safe (it is #4751's alias with a different
    separator).
  2. A bare tools (or functions) as the name: the call is that tool only when exactly one declared tool
    accepts the call's parameters (its parameter names a subset of that tool's properties, the tool's required ones
    present). Otherwise text as today. This is a guess from the arguments, so maybe behind the recovery switch, or opt-in.

An exactly declared name keeps winning over any alias, as now (a tool really named tools is unaffected).

Possible change (sketch, serve/frontend.py, the #4751 loop)

for name in self.schemas:
    if isinstance(name, str) and name:
        for prefix in ("tools.", "functions.", "default_api.",
                       "tools ", "functions ", "default_api "):     # new: space spelling
            aliases.setdefault(prefix + name, set()).add(name)

and, for case 2, where a call's name is resolved: if the name is tools / functions, not declared and not an alias,
pick the single declared tool whose schema accepts the call's parameter names.

  • #4751 (the tools. / functions. / default_api. prefixes this extends)
  • #3796 (undeclared tool calls returned as text), #4710 / #4622 (letting an undeclared name come back as a call, so the
    harness can answer "unknown tool" and the model retries instead of the turn ending)
Originally created by @ludiazv on GitHub (Nov 6, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/5409 ### What happens With a harness that also offers a code-mode tool (the model writes JavaScript that calls the other tools as `tools.<name>(...)`), Qwen3.8-Flash-Next sometimes carries that spelling into a native call's function name, with a **space instead of the dot**, or **the bare prefix alone**: ``` <tool_call> <function=tools actio> <parameter=command> ... </parameter> </function> </tool_call> ``` ``` <tool_call> <function=tools> <parameter=command> ... </parameter> </function> </tool_call> ``` The declared tool is `actio` (parameters include `command`). Neither name matches a declared tool or one of the aliases in `OutputParser.__init__` (serve/frontend.py, the #4751 block: `tools.`, `functions.`, `default_api.` + name), so the block is returned as answer text and the turn ends (`finish_reason: stop`). The harness (Pi) shows the raw block instead of running the call, and the agent stalls until the user intervenes. ### Setup - Strata v0.2.10 (Control / engine 0.1.56), Linux, one RTX 3090 + RAM experts, Qwen3.8-Flash-Next ISTA-DASLab GSQ-RCO IQ3_S, MTP drafter, default `tool_call_recovery` (on). The alias rule is the same in v0.2.11 and on main. - Harness: Pi (`pi/1.x`) through an OpenAI-compatible proxy (llama-swap), Chat Completions with `tools`. Declared tools: `read`, `bash`, `write`, `edit`, `codemode`, `actio`, `budget`. `codemode` runs JavaScript in which the other tools are `tools.read(...)`, `tools.actio(...)`, etc. ### How often One long agent session (494 assistant turns, all Flash-Next): 516 tool calls parsed correctly (158 of them `codemode`), **2 returned as text**: one `<function=tools>`, one `<function=tools actio>`. Both came during code-mode work; the second directly followed a `codemode` call that used `tools.actio(...)` (it failed on a parameter error, and the model then tried a native call to inspect the tool). ### Expected The same unambiguous-alias rule as #4751, extended to the spellings Qwen produced here: 1. **`<prefix> <name>`** with a space, for the existing prefixes (`tools`, `functions`, `default_api`): an alias of `<name>` when exactly one declared tool has that name. This one seems safe (it is #4751's alias with a different separator). 2. **A bare `tools`** (or `functions`) as the name: the call is that tool only when **exactly one** declared tool accepts the call's parameters (its parameter names a subset of that tool's properties, the tool's required ones present). Otherwise text as today. This is a guess from the arguments, so maybe behind the recovery switch, or opt-in. An exactly declared name keeps winning over any alias, as now (a tool really named `tools` is unaffected). ### Possible change (sketch, serve/frontend.py, the #4751 loop) ```python for name in self.schemas: if isinstance(name, str) and name: for prefix in ("tools.", "functions.", "default_api.", "tools ", "functions ", "default_api "): # new: space spelling aliases.setdefault(prefix + name, set()).add(name) ``` and, for case 2, where a call's name is resolved: if the name is `tools` / `functions`, not declared and not an alias, pick the single declared tool whose schema accepts the call's parameter names. ### Related - #4751 (the `tools.` / `functions.` / `default_api.` prefixes this extends) - #3796 (undeclared tool calls returned as text), #4710 / #4622 (letting an undeclared name come back as a call, so the harness can answer "unknown tool" and the model retries instead of the turn ending)
Author
Owner

@Niko1221 commented on GitHub (Nov 7, 2026):

Fixed: <function=tools NAME> (space form) and a bare <function=tools> are now read as the declared tool when the name matches a declared tool; otherwise nothing changes (68ab15ddc, b1541ab24).

Released in Strata v0.2.12: https://github.com/Niko1221/Strata/releases/tag/v0.2.12

<!-- gh-comment-id:6704752484 --> @Niko1221 commented on GitHub (Nov 7, 2026): Fixed: `<function=tools NAME>` (space form) and a bare `<function=tools>` are now read as the declared tool when the name matches a declared tool; otherwise nothing changes (68ab15ddc, b1541ab24). Released in Strata v0.2.12: https://github.com/Niko1221/Strata/releases/tag/v0.2.12
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#3232
No description provided.