[GH-ISSUE #4622] [Engine] Let the harness decide undeclared tool-call names: add a switch and a non-terminal refusal #2097

Open
opened 2026-11-04 01:56:39 +07:00 by bsakaguchi · 8 comments
Owner

Originally created by @ackalker on GitHub (Oct 29, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4622

Area

[Engine]

What do you want to do?

Two narrow things, both about the path where a well-formed call names a tool the request did not declare:

  1. A documented switch for that path, e.g. undeclared_tool_calls: "text" | "call" (config key, default "text" = today's behaviour). Harnesses that have their own unknown-name policy want the call back as tool_calls, which is what happened before 0.2.2.
  2. On the current default path, make the refusal non-terminal. Today docs/DETAILS.md:495-509 states finish_reason stays stop (or end_turn) and the block is returned as the text the model wrote. An OpenAI-shaped client reads that as a finished answer and ends the turn: nothing runs, no error, no retry, and the user has to notice and re-prompt. We would ask that a refusal carry a signal the client's own loop already understands: finish_reason: "tool_calls" alongside strata_rejected_tool_calls, or an explicit error.

We are not asking you to change the default, to weaken the alias policy, or to guess names — "bash is not shell" and the reordered-name rule are both right, and the declared-only check itself is reasonable. The ask is only: let the operator choose, and don't make a refusal indistinguishable from a completed answer.

Why the marker is not enough on its own: strata_rejected_tool_calls is a good addition and we will read it, but a vendor-specific field is invisible to every client that does not already know it — and those clients do not error, they just stop.

The problem we see (Pi, a sixth client)

Pi (earendil-works/pi) against qwen3.8-flash-next-iq3_s through llama-swap, 16 declared tools, thinking on. The model intermittently writes the name wrong: <function=tools__web_search>, <function=tools=web_search>, <function=tools> with the real name in the first parameter slot, <function=tools.web_search>. web_search is declared, and those same sessions call declared tools correctly 27-236 times each (web_search itself 2-6 times), so this is intermittent, not a broken schema. The tools token is seeded by Pi's own tool descriptions, which end with a line of the form "Codemode: tools.<name>(args) resolves to ..." — we fixed that upstream (earendil-works/pi#11573, branch codemode-script-name-annotation, commit f14912eb1), so the trigger is rarer on our side already.

What the policy does to our loop, measured in our own session store:

  • 6 sessions contain such a turn (4 different spellings: tools__web_search, tools=web_search, tools, tools.web_search, and one <function=AskUserQuestion> — a name from another harness). In 5 of the 6 it is the first assistant reply of the session. The whole call block is message text, stopReason is stop, nothing runs, and the session continues only because the user re-prompts (one typed "Please retry.", the others re-sent the same request).
  • Across all 154 session directories and ~26,700 tool calls there is not one call delivered with a junk name. Pi's Tool "..." not found tool-result error — which is exactly the recovery your docs recommend ("answer the model with the tool names it does have and ask again") — never fires, because the call never reaches the client.
  • Pi cannot see the marker today either: the SSE partial merge in createPartialCompletion (packages/ai/src/utils/error-body.ts:130) copies content, tool_calls and finish_reason only, so an unknown top-level field is dropped on the floor. A marker-only design needs a code change in every client; a finish_reason change needs none.

Offline, no GPU, OutputParser(thinking=False, tools=<the 16 real schemas>) at v0.2.7.1: all four spellings above give calls = 0, unread = 1, unread_names = ['tools=web_search'] (etc.), and content byte-identical to what the client displayed. tool_call_recovery: true does not change any of them. The aliases at serve/frontend.py:1006-1017 only rewrite the part after a dot, so tools / tools__web_search / tools=web_search are not covered and never will be — the model, not the spelling table, is the variable.

Why a switch, and what precedent

llama.cpp screens by construction too and silently: its autoparser builds the <function=NAME> alternatives from the declared tools only (common/chat-peg-parser.cpp:505-517, tool_choices |= rule("tool-" + name, ...) inside for (const auto & tool_def : tools), whole section optional(...) unless force_tool_calls). So we are not asking Strata to be unlike llama.cpp. vLLM is the precedent for the knob we want: validate_tool_names: bool = False ("Reject tool calls whose names are absent from the request tools", vllm/parser/engine/parser_engine_config.py:138-139, enforced in _is_valid_tool_name, vllm/parser/engine/parser_engine.py:467-475) — same capability, opt-in, pass-through by default.

Two things in your own tree that argue a knob is cheap:

  • strata_rejected_tool_calls is read by nobody, including Strata. git grep finds it only in serve/server.py, test_server.py and the docs; nothing in apps/host/server/agent/ mentions it, so a Strata-driven agent hits the same silent stop.
  • The Responses route already carries a per-client exception ("The Responses route keeps returning calls from a request without tools because Codex's compaction request relies on it", #3075 close). A config key is the general form of that exception.

What do you do today instead?

We re-prompt by hand, and we carry a local 20-line patch that recovers a junk prefix before = (<function=tools=web_search>). That covers one family only — it does nothing for <function=tools> or <function=tools__web_search> — so it is not a real workaround. Our other option is to stop declaring tools for Pi, which we do not want.

Relation to existing threads

Same class as #3796 (we are the fifth/sixth client) and the same path introduced by 70f42407 for #3075. Per CONTRIBUTING rule 3 we are raising the config/behaviour scope question here rather than reopening #3796, and we have left a pointer there with the new evidence. Pi's side of the fix is in earendil-works/pi#11573, which also asks Pi to read strata_rejected_tool_calls; the ask here is that no client has to.

Originally created by @ackalker on GitHub (Oct 29, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4622 ### Area [Engine] ### What do you want to do? Two narrow things, both about the path where a well-formed call names a tool the request did not declare: 1. **A documented switch** for that path, e.g. `undeclared_tool_calls: "text" | "call"` (config key, default `"text"` = today's behaviour). Harnesses that have their own unknown-name policy want the call back as `tool_calls`, which is what happened before 0.2.2. 2. **On the current default path, make the refusal non-terminal.** Today `docs/DETAILS.md:495-509` states `finish_reason` stays `stop` (or `end_turn`) and the block is returned as the text the model wrote. An OpenAI-shaped client reads that as a finished answer and ends the turn: nothing runs, no error, no retry, and the user has to notice and re-prompt. We would ask that a refusal carry a signal the client's own loop already understands: `finish_reason: "tool_calls"` alongside `strata_rejected_tool_calls`, or an explicit error. We are **not** asking you to change the default, to weaken the alias policy, or to guess names — "`bash` is not `shell`" and the reordered-name rule are both right, and the declared-only check itself is reasonable. The ask is only: let the operator choose, and don't make a refusal indistinguishable from a completed answer. Why the marker is not enough on its own: `strata_rejected_tool_calls` is a good addition and we will read it, but a vendor-specific field is invisible to every client that does not already know it — and those clients do not error, they just stop. ### The problem we see (Pi, a sixth client) Pi (earendil-works/pi) against `qwen3.8-flash-next-iq3_s` through llama-swap, 16 declared tools, thinking on. The model intermittently writes the name wrong: `<function=tools__web_search>`, `<function=tools=web_search>`, `<function=tools>` with the real name in the first parameter slot, `<function=tools.web_search>`. `web_search` is declared, and those same sessions call declared tools correctly 27-236 times each (`web_search` itself 2-6 times), so this is intermittent, not a broken schema. The `tools` token is seeded by Pi's own tool descriptions, which end with a line of the form "Codemode: `tools.<name>(args)` resolves to ..." — we fixed that upstream (earendil-works/pi#11573, branch `codemode-script-name-annotation`, commit `f14912eb1`), so the trigger is rarer on our side already. What the policy does to our loop, measured in our own session store: - 6 sessions contain such a turn (4 different spellings: `tools__web_search`, `tools=web_search`, `tools`, `tools.web_search`, and one `<function=AskUserQuestion>` — a name from another harness). In 5 of the 6 it is the **first** assistant reply of the session. The whole call block is message text, `stopReason` is `stop`, nothing runs, and the session continues only because the user re-prompts (one typed "Please retry.", the others re-sent the same request). - Across all 154 session directories and ~26,700 tool calls there is **not one** call delivered with a junk name. Pi's `Tool "..." not found` tool-result error — which is exactly the recovery your docs recommend ("answer the model with the tool names it does have and ask again") — never fires, because the call never reaches the client. - Pi cannot see the marker today either: the SSE partial merge in `createPartialCompletion` (`packages/ai/src/utils/error-body.ts:130`) copies `content`, `tool_calls` and `finish_reason` only, so an unknown top-level field is dropped on the floor. A marker-only design needs a code change in every client; a `finish_reason` change needs none. Offline, no GPU, `OutputParser(thinking=False, tools=<the 16 real schemas>)` at v0.2.7.1: all four spellings above give `calls = 0`, `unread = 1`, `unread_names = ['tools=web_search']` (etc.), and `content` byte-identical to what the client displayed. `tool_call_recovery: true` does not change any of them. The aliases at `serve/frontend.py:1006-1017` only rewrite the part after a dot, so `tools` / `tools__web_search` / `tools=web_search` are not covered and never will be — the model, not the spelling table, is the variable. ### Why a switch, and what precedent llama.cpp screens by construction too and silently: its autoparser builds the `<function=NAME>` alternatives from the declared tools only (`common/chat-peg-parser.cpp:505-517`, `tool_choices |= rule("tool-" + name, ...)` inside `for (const auto & tool_def : tools)`, whole section `optional(...)` unless `force_tool_calls`). So we are not asking Strata to be unlike llama.cpp. vLLM is the precedent for the knob we want: `validate_tool_names: bool = False` ("Reject tool calls whose names are absent from the request tools", `vllm/parser/engine/parser_engine_config.py:138-139`, enforced in `_is_valid_tool_name`, `vllm/parser/engine/parser_engine.py:467-475`) — same capability, opt-in, pass-through by default. Two things in your own tree that argue a knob is cheap: - `strata_rejected_tool_calls` is read by nobody, including Strata. `git grep` finds it only in `serve/server.py`, `test_server.py` and the docs; nothing in `apps/host/server/agent/` mentions it, so a Strata-driven agent hits the same silent stop. - The Responses route already carries a per-client exception ("The Responses route keeps returning calls from a request without tools because Codex's compaction request relies on it", #3075 close). A config key is the general form of that exception. ### What do you do today instead? We re-prompt by hand, and we carry a local 20-line patch that recovers a junk prefix before `=` (`<function=tools=web_search>`). That covers one family only — it does nothing for `<function=tools>` or `<function=tools__web_search>` — so it is not a real workaround. Our other option is to stop declaring tools for Pi, which we do not want. ### Relation to existing threads Same class as #3796 (we are the fifth/sixth client) and the same path introduced by `70f42407` for #3075. Per CONTRIBUTING rule 3 we are raising the config/behaviour scope question here rather than reopening #3796, and we have left a pointer there with the new evidence. Pi's side of the fix is in earendil-works/pi#11573, which also asks Pi to read `strata_rejected_tool_calls`; the ask here is that no client has to.
Author
Owner

@ackalker commented on GitHub (Oct 29, 2026):

Following up with the framing that made me file this, because it is a protocol-spec argument rather than a client-complaint list.

We modelled the loop as a state machine over the outcomes a reply can express, and asked: which transitions can end the turn without a reason? That turns up six gaps in one pass, and this issue is gap G1.

outcome a reply should express harness transition terminal?
O1 tool calls (executable) act, continue no
O2 final answer + explicit completion claim terminate yes
O3 refusal with a reason inject an error/tool result, recover no
O4 token/budget limit hit continue or escalate no
O5 provider/engine failure retry only after N tries
O6 empty answer, no calls illegal: must be O3 or a fatal no

The rule that falls out is one line: absence is not an outcome. Today O2 is encoded as "no tool_calls and finish_reason: stop", i.e. as an absence. So anything upstream that adds or removes calls silently fabricates or destroys a terminal transition.

Six gaps, each with a real instance, including three of your own closed issues:

gap what happened instance
G1 a call became prose and finish_reason stayed stop: O1 destroyed, indistinguishable from O2 this issue; #3796 (15 of 34 Codex sessions); 6 sessions in our own store
G2 phantom calls plus content: "": O1 invented, the client's else branch wrote an empty artifact #3075, before the fix
G3 the reply is reasoning only: no answer, no call, terminal #1053, which is why reasoning_close_retry exists (docs/DETAILS.md:470)
G4 a call inside {TC} returned as reasoning_content, finish stop: same gap, different channel #804, the origin of the if self.schemas gate
G5 markup inside a parameter value runs the tool with truncated arguments: not a stall, a silent wrong action #4078
G6 the engine died mid-stream and the turn looked finished our logs: the engine stopped unexpectedly (exit code -15), Stream ended without finish_reason

Three invariants would close G1-G4 and G6:

  1. Every reply carries exactly one outcome from a closed set, and O2 requires a positive completion marker rather than the absence of calls.
  2. No transition to terminal without a reason code the harness can branch on. This is the whole ask: finish_reason (or an explicit error), not silence next to strata_rejected_tool_calls.
  3. Every non-terminal stall has an owner: retry, inject-error-and-recover, or escalate. A turn with no action, no completion claim and no error is an illegal state and should trip.

G2 and G4 are already handled in your code, which is the useful part of this comparison: both are refusals that became expressible (the if self.schemas gate, and reasoning_close_retry as an opt-in transition). G1 is the remaining case where a refusal is expressed only to a client that reads a vendor field, while finish_reason claims the turn ended normally.

Worth noting the limit of this framing so nobody tries to check it and gives up: the protocol layer (O1-O6, G1-G6) is fully interlockable. The semantic layer is not — a harness can never verify "task complete", only read the model's claim, so progress checking there is heuristics. We are asking only about the interlockable half.

And a correction to my own report: our tools/tools__web_search spellings are partly our fault — Pi's tool descriptions seed the tools. token. That is fixed upstream (earendil-works/pi#11573). It reduces the trigger for one client; it does not touch the class, which is models naming bash for shell, apply_patch for exec_command, and skills_read behind a tool_call wrapper.

<!-- gh-comment-id:6502291448 --> @ackalker commented on GitHub (Oct 29, 2026): Following up with the framing that made me file this, because it is a protocol-spec argument rather than a client-complaint list. We modelled the loop as a state machine over the outcomes a reply can express, and asked: which transitions can end the turn without a reason? That turns up six gaps in one pass, and this issue is gap G1. | outcome a reply should express | harness transition | terminal? | |---|---|---| | O1 tool calls (executable) | act, continue | no | | O2 final answer + explicit completion claim | terminate | yes | | O3 refusal with a reason | inject an error/tool result, recover | no | | O4 token/budget limit hit | continue or escalate | no | | O5 provider/engine failure | retry | only after N tries | | O6 empty answer, no calls | illegal: must be O3 or a fatal | no | The rule that falls out is one line: **absence is not an outcome.** Today O2 is encoded as "no `tool_calls` and `finish_reason: stop`", i.e. as an absence. So anything upstream that adds or removes calls silently fabricates or destroys a terminal transition. Six gaps, each with a real instance, including three of your own closed issues: | gap | what happened | instance | |---|---|---| | G1 | a call became prose and `finish_reason` stayed `stop`: O1 destroyed, indistinguishable from O2 | this issue; #3796 (15 of 34 Codex sessions); 6 sessions in our own store | | G2 | phantom calls plus `content: ""`: O1 invented, the client's `else` branch wrote an empty artifact | #3075, before the fix | | G3 | the reply is reasoning only: no answer, no call, terminal | #1053, which is why `reasoning_close_retry` exists (docs/DETAILS.md:470) | | G4 | a call inside `{TC}` returned as `reasoning_content`, finish `stop`: same gap, different channel | #804, the origin of the `if self.schemas` gate | | G5 | markup inside a parameter value runs the tool with truncated arguments: not a stall, a silent wrong action | #4078 | | G6 | the engine died mid-stream and the turn looked finished | our logs: `the engine stopped unexpectedly (exit code -15)`, `Stream ended without finish_reason` | Three invariants would close G1-G4 and G6: 1. Every reply carries exactly one outcome from a closed set, and O2 requires a positive completion marker rather than the absence of calls. 2. No transition to terminal without a reason code the harness can branch on. This is the whole ask: `finish_reason` (or an explicit error), not silence next to `strata_rejected_tool_calls`. 3. Every non-terminal stall has an owner: retry, inject-error-and-recover, or escalate. A turn with no action, no completion claim and no error is an illegal state and should trip. G2 and G4 are already handled in your code, which is the useful part of this comparison: both are refusals that became *expressible* (the `if self.schemas` gate, and `reasoning_close_retry` as an opt-in transition). G1 is the remaining case where a refusal is expressed only to a client that reads a vendor field, while `finish_reason` claims the turn ended normally. Worth noting the limit of this framing so nobody tries to check it and gives up: the protocol layer (O1-O6, G1-G6) is fully interlockable. The semantic layer is not — a harness can never verify "task complete", only read the model's claim, so progress checking there is heuristics. We are asking only about the interlockable half. And a correction to my own report: our `tools`/`tools__web_search` spellings are partly our fault — Pi's tool descriptions seed the `tools.` token. That is fixed upstream (earendil-works/pi#11573). It reduces the trigger for one client; it does not touch the class, which is models naming `bash` for `shell`, `apply_patch` for `exec_command`, and `skills_read` behind a `tool_call` wrapper.
Author
Owner

@TacoTakumi commented on GitHub (Nov 2, 2026):

I hit this from a different kind of client, and it adds one point to the case for the switch in point 1.

The client is a voice game. The model is a Qwen3.8 Flash Next finetune (Swift 1.5 IQ4_XS) on Strata 0.2.7.1 through llama-swap, with streaming on. The reply text goes to TTS while it streams. In two turns in a row, the model wrote a well formed call with a name that the request did not declare:

<tool_call>
<function=let PlayerClass>
<parameter=class_name>
fighter
</parameter>
</function>
</tool_call>

The next turn used match_class_for_player. The declared tool is set_player_class. Strata returned both blocks as content, and the TTS read the XML aloud to the player.

For a streaming client, the marker and finish_reason both come too late. The block streams as content first. strata_rejected_tool_calls and finish_reason come only in the last chunk, after the text is already spoken. To act on the marker, the client must hold back all text until the stream ends, and then there is no reason to stream. A finish_reason change alone has the same problem.

These names are also not near misses. No alias rule can map let PlayerClass (a hallucination) to set_player_class, and it should not try. The switch is the fix we need. Our loop already answers an unknown name with a tool error, so the model can try again.

Until there is a switch, I'll detect a tool call block at the start of the streamed text, keep it from TTS, and send the model an error.

<!-- gh-comment-id:6588152626 --> @TacoTakumi commented on GitHub (Nov 2, 2026): I hit this from a different kind of client, and it adds one point to the case for the switch in point 1. The client is a voice game. The model is a Qwen3.8 Flash Next finetune (Swift 1.5 IQ4_XS) on Strata 0.2.7.1 through llama-swap, with streaming on. The reply text goes to TTS while it streams. In two turns in a row, the model wrote a well formed call with a name that the request did not declare: ``` <tool_call> <function=let PlayerClass> <parameter=class_name> fighter </parameter> </function> </tool_call> ``` The next turn used match_class_for_player. The declared tool is set_player_class. Strata returned both blocks as content, and the TTS read the XML aloud to the player. For a streaming client, the marker and finish_reason both come too late. The block streams as content first. strata_rejected_tool_calls and finish_reason come only in the last chunk, after the text is already spoken. To act on the marker, the client must hold back all text until the stream ends, and then there is no reason to stream. A finish_reason change alone has the same problem. These names are also not near misses. No alias rule can map let PlayerClass (a hallucination) to set_player_class, and it should not try. The switch is the fix we need. Our loop already answers an unknown name with a tool error, so the model can try again. Until there is a switch, I'll detect a tool call block at the start of the streamed text, keep it from TTS, and send the model an error.
Author
Owner

@marksmeltzer commented on GitHub (Nov 3, 2026):

Field data from a rig where the miss fires on ordinary harness traffic, in case the frequency question is what is holding the switch back.

We run Strata as the model behind GitHub Copilot in VS Code and the GitHub Copilot CLI, all day, on:

  • 2 × RTX 5090, Ryzen 9 5950X, 128 GiB RAM, Windows 11 Pro build 26200, driver 32.0.16.1742
  • Strata 0.2.9 with engine 0.1.54, serving qwen3.8-flash-next-unsloth-ud-q4_k_xl at 262144 context
  • both clients declaring tools, which is the configuration this issue describes as wanting a call back

What we counted

window requests undeclared tool calls returned as calls share of requests
18 h 52 m of continuous daily-driver use, 2026-11-02 2,322 6 0.26 %

The six counted here were returned to us as calls, because we run undeclared_tool_calls: "call". The count is mode-dependent: serve/frontend.py _call_event increments undeclared_passed only when undeclared_calls is on, and serve/server.py adds that to totals.tool_calls_undeclared. On the default setting those same six would have come back as text with nothing in the response to distinguish them from a finished answer. A second snapshot of the same process later the same evening read 2,390 requests and still 6, so it isn't one bad conversation.

For scale, that 18 h 52 m window carried 281 M prompt tokens, 276 M of them reused: warm, long-context, tools-declared traffic.

Why that argues for the switch

0.26 % is rare enough that nobody finds it from symptoms and frequent enough that a harness used every day meets it within a day. What makes it need a switch rather than a workaround is that the text path gives the client no signal: the turn ends, nothing runs, and a user who hits this four times in a week gets four normal-looking finished answers and no way to connect them. Whatever the percentage, the operator has no way to know it is happening without a server-side counter, which is why the metrics half of this paired pull request matters even if the default stays "text".

What this does not measure

  • Which names, and what each client did next. totals.tool_calls_undeclared counts calls, not names, and records no outcome. We are not claiming the six turns would otherwise have been lost; we don't know what each client did.
  • "text". We have not run the default path alongside this one, so the comparison between the two settings is read off the code, not measured.
  • Replay. Passive counting on live traffic, not the replay methodology used above. One model on one rig is the whole sample; another client or model could sit at a very different rate.
<!-- gh-comment-id:6594692840 --> @marksmeltzer commented on GitHub (Nov 3, 2026): Field data from a rig where the miss fires on ordinary harness traffic, in case the frequency question is what is holding the switch back. We run Strata as the model behind GitHub Copilot in VS Code and the GitHub Copilot CLI, all day, on: - 2 × RTX 5090, Ryzen 9 5950X, 128 GiB RAM, Windows 11 Pro build 26200, driver 32.0.16.1742 - Strata 0.2.9 with engine 0.1.54, serving `qwen3.8-flash-next-unsloth-ud-q4_k_xl` at 262144 context - both clients declaring tools, which is the configuration this issue describes as wanting a call back ## What we counted | window | requests | undeclared tool calls returned as calls | share of requests | |---|---|---|---| | 18 h 52 m of continuous daily-driver use, 2026-11-02 | 2,322 | **6** | **0.26 %** | The six counted here were returned to us as calls, because we run `undeclared_tool_calls: "call"`. The count is mode-dependent: `serve/frontend.py` `_call_event` increments `undeclared_passed` only when `undeclared_calls` is on, and `serve/server.py` adds that to `totals.tool_calls_undeclared`. On the default setting those same six would have come back as text with nothing in the response to distinguish them from a finished answer. A second snapshot of the same process later the same evening read 2,390 requests and still 6, so it isn't one bad conversation. For scale, that 18 h 52 m window carried 281 M prompt tokens, 276 M of them reused: warm, long-context, tools-declared traffic. ## Why that argues for the switch 0.26 % is rare enough that nobody finds it from symptoms and frequent enough that a harness used every day meets it within a day. What makes it need a switch rather than a workaround is that the text path gives the client no signal: the turn ends, nothing runs, and a user who hits this four times in a week gets four normal-looking finished answers and no way to connect them. Whatever the percentage, the operator has no way to know it is happening without a server-side counter, which is why the metrics half of this paired pull request matters even if the default stays `"text"`. ## What this does not measure - **Which names, and what each client did next.** `totals.tool_calls_undeclared` counts calls, not names, and records no outcome. We are not claiming the six turns would otherwise have been lost; we don't know what each client did. - **`"text"`.** We have not run the default path alongside this one, so the comparison between the two settings is read off the code, not measured. - **Replay.** Passive counting on live traffic, not the replay methodology used above. One model on one rig is the whole sample; another client or model could sit at a very different rate.
Author
Owner

@marksmeltzer commented on GitHub (Nov 3, 2026):

Addendum to our earlier measurement: a call the model wrote correctly enough to mean, with a tag it never closed,
is invisible to both counters. Found in daily use 2026-11-03.

What we saw

One agent session, this server (2x RTX 5090, driver 617.42, qwen3.8-flash-next-unsloth-ud-q4_k_xl, context
262144), running our opt-in "undeclared_tool_calls": "call". The model emitted a tool call whose tool name
arrived complete but whose function tag was never closed: a stray closing parameter tag stood where the tag's >
belonged. The reply went back as ordinary text. The harness reported a malformed tool call and ended the turn. The
model was never told which part was wrong, and by then the tool's name existed only as prose in its own transcript,
so there was nothing to correct and no retry to make.

We are deliberately not pasting the markup. In a harness that reads a reply's text for calls, the damaged sequence
is itself a tool-call attempt - that is exactly how the session that found it lost its turn. Describe, don't quote.

Why our 0.26 % is a floor, and this is the reason

Both counters read zero on that request, for two unrelated reasons:

  • tool_calls_unread is incremented in the branch that keeps the block as text. A server running "call" does not
    take that branch, so it cannot count this.
  • tool_calls_undeclared counts calls the parser recognised as calls. Recognition needs the name and the tag's
    closing bracket. With the bracket missing, the block is never a call and never a rejected call: it is content.

A rate built from either counter therefore measures only the calls that were legible. Every number of this kind,
ours included, is a lower bound, and the true share of requests where the model writes a call the pipeline cannot
read is "that rate, plus whatever the invisible class contributes". We have given the class a counter now, but it
starts at zero, so we cannot say how large it is. One observed instance in continuous daily-driver use is all we have.

Why the two v0.2.10 additions we reviewed do not rescue this case

  • #4751 adds tools., functions. and default_api. as aliases of a declared name. In our instance the name
    has a word inserted inside it, not a harness prefix in front of a real name, so no alias resolves it.
  • #4663 treats a call for an undeclared name as callable when the request defers its tool list. Different
    request shape; and in any case the block never becomes a call, because the blocker is the opener, not the name.

It is also a third failure mode beside #3441's drifted opener: there the word is spelled wrong and the tag closes,
and the rewrite in v0.2.10 handles it. Here the word is right and the tag never closes, so nothing rewrites it.

What we did, on our side of the same failure

With "undeclared_tool_calls": "call" set, the parser detects the shape and completes the opener - the same move
#3441 makes for a drifted opener - and lets the existing call path recover the arguments. The client receives a
call carrying the name the model actually wrote and rejects it with its own "no such tool" error. That error is
the correction signal the model can act on, so the turn continues instead of ending. Three guards keep it narrow:

  • the name is never guessed at or normalised; what the model wrote is what the client is asked about;
  • it fires only when the text standing in place of the > begins call markup (a closing tag, a brace, or a
    parameter), so a sentence that merely names a function stays text;
  • while the deciding text has not arrived, it holds rather than answering. Our first draft missed that and repaired
    only a reply that arrived all at once, while token-by-token delivery skipped it entirely - worth stating because
    it is the bug a fix like this most easily hides.

With the switch off the reply is byte-identical to today's, which is our usual condition for touching the default
path at all.

Why the server does not simply answer the model itself

Auto-responding is what we would have preferred: recognise the damage, tell the model its call was malformed, skip
the client. It is not reliably possible for the traffic that matters. In a chat-completions or messages response
the server produces one HTTP reply, and a tool-result message is only meaningful as an answer to a tool_calls
array whose ids the client minted and holds in its own conversation state. A server answering on the client's
behalf would have to invent the client's assistant turn and hope it got replayed. Strata does have a loop that
feeds tool results back to the model - it exists for the server's own MCP hub, gated on mcp_servers on the
request or --mcp-config on the command line. Requests from an agent harness set neither. So we route, and let
the harness produce the error. If upstream would rather normalise the opener into a call for an unknown name
unconditionally rather than behind a switch, the seam we wrote it at is small enough to move.

We gave the class a number

A failure mode with no counter cannot be reasoned about, only argued about. Added: totals.tool_calls_malformed_open
in /metrics, and a MALFORMED TOOL CALL request ... line in the server log beside the undeclared one. It counts
repaired-and-returned calls, so - same caveat as the other two - it never moves on a server left on the default,
and a zero from a default server is not evidence that the shape does not occur.

How it was checked, and what was not

  • Parser level: both damaged spellings (missing bracket, stray closing tag) at whole-reply, one-character and
    seven-character chunk widths, asserting the name and arguments survive, that nothing reaches the transcript as
    text, and that the counters agree. Plus: switch off unchanged; a declared name behind the damage still executes;
    a well-formed call unaffected; prose unaffected with the switch both on and off; a name still arriving held, not
    named. serve/test_undeclared_tool_calls.py, 19 tests.
  • Whole serve suite: 1404 tests, OK, 30 skipped, 533 s, 2026-11-03 on 2x RTX 5090 (driver 617.42),
    Ryzen 9 5950X, 128 GiB, Windows 11 build 26200.
  • Not tested: end to end with a real harness on a server running engine 0.1.56. This machine was serving the very
    conversation in which the change was written, so the engine is still 0.1.54 while we write this - we have not
    seen a repaired call in production, only in tests. The observation is one instance on one rig with one model, not
    a rate, and we did not measure how often the shape occurs on any other model, quant, hardware, or server default
    than ours.
<!-- gh-comment-id:6612617810 --> @marksmeltzer commented on GitHub (Nov 3, 2026): Addendum to our earlier measurement: a call the model wrote correctly enough to mean, with a tag it never closed, is invisible to both counters. Found in daily use 2026-11-03. **What we saw** One agent session, this server (2x RTX 5090, driver 617.42, `qwen3.8-flash-next-unsloth-ud-q4_k_xl`, context 262144), running our opt-in `"undeclared_tool_calls": "call"`. The model emitted a tool call whose tool name arrived complete but whose function tag was never closed: a stray closing parameter tag stood where the tag's `>` belonged. The reply went back as ordinary text. The harness reported a malformed tool call and ended the turn. The model was never told which part was wrong, and by then the tool's name existed only as prose in its own transcript, so there was nothing to correct and no retry to make. We are deliberately not pasting the markup. In a harness that reads a reply's text for calls, the damaged sequence is itself a tool-call attempt - that is exactly how the session that found it lost its turn. Describe, don't quote. **Why our 0.26 % is a floor, and this is the reason** Both counters read zero on that request, for two unrelated reasons: - `tool_calls_unread` is incremented in the branch that keeps the block as text. A server running `"call"` does not take that branch, so it cannot count this. - `tool_calls_undeclared` counts calls the parser recognised as calls. Recognition needs the name *and* the tag's closing bracket. With the bracket missing, the block is never a call and never a rejected call: it is content. A rate built from either counter therefore measures only the calls that were legible. Every number of this kind, ours included, is a lower bound, and the true share of requests where the model writes a call the pipeline cannot read is "that rate, plus whatever the invisible class contributes". We have given the class a counter now, but it starts at zero, so we cannot say how large it is. One observed instance in continuous daily-driver use is all we have. **Why the two `v0.2.10` additions we reviewed do not rescue this case** - **#4751** adds `tools.`, `functions.` and `default_api.` as aliases of a declared name. In our instance the name has a word inserted *inside* it, not a harness prefix in front of a real name, so no alias resolves it. - **#4663** treats a call for an undeclared name as callable when the request defers its tool list. Different request shape; and in any case the block never becomes a call, because the blocker is the opener, not the name. It is also a third failure mode beside #3441's drifted opener: there the word is spelled wrong and the tag closes, and the rewrite in `v0.2.10` handles it. Here the word is right and the tag never closes, so nothing rewrites it. **What we did, on our side of the same failure** With `"undeclared_tool_calls": "call"` set, the parser detects the shape and completes the opener - the same move #3441 makes for a drifted opener - and lets the existing call path recover the arguments. The client receives a call carrying the name the model actually wrote and rejects it with its own "no such tool" error. That error is the correction signal the model can act on, so the turn continues instead of ending. Three guards keep it narrow: - the name is never guessed at or normalised; what the model wrote is what the client is asked about; - it fires only when the text standing in place of the `>` begins call markup (a closing tag, a brace, or a parameter), so a sentence that merely names a function stays text; - while the deciding text has not arrived, it holds rather than answering. Our first draft missed that and repaired only a reply that arrived all at once, while token-by-token delivery skipped it entirely - worth stating because it is the bug a fix like this most easily hides. With the switch off the reply is byte-identical to today's, which is our usual condition for touching the default path at all. **Why the server does not simply answer the model itself** Auto-responding is what we would have preferred: recognise the damage, tell the model its call was malformed, skip the client. It is not reliably possible for the traffic that matters. In a chat-completions or messages response the server produces one HTTP reply, and a tool-result message is only meaningful as an answer to a `tool_calls` array whose ids the client minted and holds in its own conversation state. A server answering on the client's behalf would have to invent the client's assistant turn and hope it got replayed. Strata does have a loop that feeds tool results back to the model - it exists for the server's own MCP hub, gated on `mcp_servers` on the request or `--mcp-config` on the command line. Requests from an agent harness set neither. So we route, and let the harness produce the error. If upstream would rather normalise the opener into a call for an unknown name unconditionally rather than behind a switch, the seam we wrote it at is small enough to move. **We gave the class a number** A failure mode with no counter cannot be reasoned about, only argued about. Added: `totals.tool_calls_malformed_open` in `/metrics`, and a `MALFORMED TOOL CALL request ...` line in the server log beside the undeclared one. It counts repaired-and-returned calls, so - same caveat as the other two - it never moves on a server left on the default, and a zero from a default server is not evidence that the shape does not occur. **How it was checked, and what was not** - Parser level: both damaged spellings (missing bracket, stray closing tag) at whole-reply, one-character and seven-character chunk widths, asserting the name and arguments survive, that nothing reaches the transcript as text, and that the counters agree. Plus: switch off unchanged; a declared name behind the damage still executes; a well-formed call unaffected; prose unaffected with the switch both on and off; a name still arriving held, not named. `serve/test_undeclared_tool_calls.py`, 19 tests. - Whole `serve` suite: 1404 tests, OK, 30 skipped, 533 s, 2026-11-03 on 2x RTX 5090 (driver 617.42), Ryzen 9 5950X, 128 GiB, Windows 11 build 26200. - Not tested: end to end with a real harness on a server running engine `0.1.56`. This machine was serving the very conversation in which the change was written, so the engine is still `0.1.54` while we write this - we have not seen a repaired call in production, only in tests. The observation is one instance on one rig with one model, not a rate, and we did not measure how often the shape occurs on any other model, quant, hardware, or server default than ours.
Author
Owner

@macmmm81 commented on GitHub (Nov 3, 2026):

I can confirm experiencing this issue with Qwen 3.8 Flash-Next (ISTA IQ3_S) running through Strata 0.2.10 (build 0.1.56; python 3.12.15 ) + DeepSeek Harness (DSH) in Programmatic Tool Calling (PTC) mode.

Environment:

  • Model: Qwen 3.8 Flash-Next, ISTA IQ3_S GGUF
  • Inference server: Strata 0.2.10 (OpenAI-compatible API)
  • Hardware: AMD Radeon RX 6800 XT, 16 GB VRAM
  • Agent framework: DeepSeek Harness
  • Tool mode: PTC (run_code)

Observed behavior:

In PTC mode, DSH exposes run_code as the callable tool, with other tools accessible through the generated TypeScript SDK.

However, Qwen intermittently attempts to invoke those underlying tools directly, producing output such as:

<tool_call>
  <function=read>
    <parameter=file_path>decomp/ASSESSMENT.md</parameter>
  </function>
</tool_call>

Instead of invoking run_code with the appropriate SDK call:

const result = await tools.read({
  file_path: "decomp/ASSESSMENT.md"
});
console.log(result);

The incorrect invocation appears as raw XML in the conversation rather than being handled as a structured tool call that DSH can reject and provide feedback on.

Interestingly, manually correcting the model works temporarily. After explicitly explaining the PTC calling convention, Qwen resumes using run_code correctly and can continue executing tools autonomously.

However, after further execution, it eventually reverts to direct XML-style tool calls, causing the same failure again.

This suggests two separate problems:

  1. The model occasionally fails to follow the PTC calling convention.
  2. The inference server / harness integration does not provide a reliable recovery path when the model attempts an undeclared tool call.

I understand the reasoning behind restricting structured tool calls to explicitly declared tools, but an opt-in mechanism such as the proposed undeclared_tool_calls: "call" option would be extremely useful for agent frameworks that already implement their own tool validation.

It would allow DSH to reject invalid calls and return actionable feedback to the model, rather than leaving raw XML in the conversation and potentially terminating an otherwise productive autonomous session.

I support making this behavior configurable while retaining the current strict behavior as the default.

Happy to provide additional logs or test a proposed fix if useful.

<!-- gh-comment-id:6617241597 --> @macmmm81 commented on GitHub (Nov 3, 2026): I can confirm experiencing this issue with **Qwen 3.8 Flash-Next (ISTA IQ3_S)** running through **Strata 0.2.10 (build 0.1.56; python 3.12.15 ) + DeepSeek Harness (DSH)** in Programmatic Tool Calling (PTC) mode. **Environment:** - Model: Qwen 3.8 Flash-Next, ISTA IQ3_S GGUF - Inference server: Strata 0.2.10 (OpenAI-compatible API) - Hardware: AMD Radeon RX 6800 XT, 16 GB VRAM - Agent framework: DeepSeek Harness - Tool mode: PTC (`run_code`) **Observed behavior:** In PTC mode, DSH exposes `run_code` as the callable tool, with other tools accessible through the generated TypeScript SDK. However, Qwen intermittently attempts to invoke those underlying tools directly, producing output such as: ```xml <tool_call> <function=read> <parameter=file_path>decomp/ASSESSMENT.md</parameter> </function> </tool_call> ``` Instead of invoking `run_code` with the appropriate SDK call: ```typescript const result = await tools.read({ file_path: "decomp/ASSESSMENT.md" }); console.log(result); ``` The incorrect invocation appears as raw XML in the conversation rather than being handled as a structured tool call that DSH can reject and provide feedback on. Interestingly, **manually correcting the model works temporarily**. After explicitly explaining the PTC calling convention, Qwen resumes using `run_code` correctly and can continue executing tools autonomously. However, after further execution, it eventually reverts to direct XML-style tool calls, causing the same failure again. This suggests two separate problems: 1. The model occasionally fails to follow the PTC calling convention. 2. The inference server / harness integration does not provide a reliable recovery path when the model attempts an undeclared tool call. I understand the reasoning behind restricting structured tool calls to explicitly declared tools, but an opt-in mechanism such as the proposed `undeclared_tool_calls: "call"` option would be extremely useful for agent frameworks that already implement their own tool validation. It would allow DSH to reject invalid calls and return actionable feedback to the model, rather than leaving raw XML in the conversation and potentially terminating an otherwise productive autonomous session. **I support making this behavior configurable while retaining the current strict behavior as the default.** Happy to provide additional logs or test a proposed fix if useful.
Author
Owner

@marksmeltzer commented on GitHub (Nov 3, 2026):

That’s exactly right.

However, have you tried adding some global instructions that are always resident and survive compaction about the DSH calling convention? Whenever it messes up, you can ask your agent to do an RCA and improve those global instructions.

Even with error handling, this will still improve your workflow to get the agent issuing the calls correctly more often.

Regards,


From: macmmm81 @.>
Sent: Tuesday, 03 November 2026 14:36:48
To: Niko1221/Strata @.
>
Cc: Mark Smeltzer (Living Agile) @.>; Comment @.>
Subject: Re: [Niko1221/Strata] [Engine] Let the harness decide undeclared tool-call names: add a switch and a non-terminal refusal (Issue #4622)

[https://avatars.githubusercontent.com/u/39221755?s=20&v=4]macmmm81 left a comment (Niko1221/Strata#4622)https://github.com/Niko1221/Strata/issues/4622#issuecomment-6617241597

I can confirm experiencing this issue with Qwen 3.8 Flash-Next (ISTA IQ3_S) running through Strata 0.2.10 (build 0.1.56; python 3.12.15 ) + DeepSeek Harness (DSH) in Programmatic Tool Calling (PTC) mode.

Environment:

  • Model: Qwen 3.8 Flash-Next, ISTA IQ3_S GGUF
  • Inference server: Strata 0.2.10 (OpenAI-compatible API)
  • Hardware: AMD Radeon RX 6800 XT, 16 GB VRAM
  • Agent framework: DeepSeek Harness
  • Tool mode: PTC (run_code)

Observed behavior:

In PTC mode, DSH exposes run_code as the callable tool, with other tools accessible through the generated TypeScript SDK.

However, Qwen intermittently attempts to invoke those underlying tools directly, producing output such as:

<tool_call>
<function=read>
<parameter=file_path>decomp/ASSESSMENT.md

</tool_call>

Instead of invoking run_code with the appropriate SDK call:

const result = await tools.read({
file_path: "decomp/ASSESSMENT.md"
});
console.log(result);

The incorrect invocation appears as raw XML in the conversation rather than being handled as a structured tool call that DSH can reject and provide feedback on.

Interestingly, manually correcting the model works temporarily. After explicitly explaining the PTC calling convention, Qwen resumes using run_code correctly and can continue executing tools autonomously.

However, after further execution, it eventually reverts to direct XML-style tool calls, causing the same failure again.

This suggests two separate problems:

  1. The model occasionally fails to follow the PTC calling convention.
  2. The inference server / harness integration does not provide a reliable recovery path when the model attempts an undeclared tool call.

I understand the reasoning behind restricting structured tool calls to explicitly declared tools, but an opt-in mechanism such as the proposed undeclared_tool_calls: "call" option would be extremely useful for agent frameworks that already implement their own tool validation.

It would allow DSH to reject invalid calls and return actionable feedback to the model, rather than leaving raw XML in the conversation and potentially terminating an otherwise productive autonomous session.

I support making this behavior configurable while retaining the current strict behavior as the default.

Happy to provide additional logs or test a proposed fix if useful.

—
Reply to this email directly, view it on GitHubhttps://github.com/Niko1221/Strata/issues/4622?email_source=notifications&email_token=AESFMY2F5YUF5Y6VLI4OTGL5XJMYBA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTMNRRG4ZDIMJVHE32M4TFMFZW63VHMNXW23LFNZ2KKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-6617241597, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AESFMYYU3X3PCKBUZSXTFRT5XJMYBAVCNFSNUABGKJSXA33TNF2G64TZHMYTGOBVHE2DMMZQGE5US43TOVSTWNRRGAZTCOBZG4ZDFILWAI.
You are receiving this because you commented.Message ID: @.***>

<!-- gh-comment-id:6618002362 --> @marksmeltzer commented on GitHub (Nov 3, 2026): That’s exactly right. However, have you tried adding some global instructions that are always resident and survive compaction about the DSH calling convention? Whenever it messes up, you can ask your agent to do an RCA and improve those global instructions. Even with error handling, this will still improve your workflow to get the agent issuing the calls correctly more often. Regards, ________________________________ From: macmmm81 ***@***.***> Sent: Tuesday, 03 November 2026 14:36:48 To: Niko1221/Strata ***@***.***> Cc: Mark Smeltzer (Living Agile) ***@***.***>; Comment ***@***.***> Subject: Re: [Niko1221/Strata] [Engine] Let the harness decide undeclared tool-call names: add a switch and a non-terminal refusal (Issue #4622) [https://avatars.githubusercontent.com/u/39221755?s=20&v=4]macmmm81 left a comment (Niko1221/Strata#4622)<https://github.com/Niko1221/Strata/issues/4622#issuecomment-6617241597> I can confirm experiencing this issue with Qwen 3.8 Flash-Next (ISTA IQ3_S) running through Strata 0.2.10 (build 0.1.56; python 3.12.15 ) + DeepSeek Harness (DSH) in Programmatic Tool Calling (PTC) mode. Environment: * Model: Qwen 3.8 Flash-Next, ISTA IQ3_S GGUF * Inference server: Strata 0.2.10 (OpenAI-compatible API) * Hardware: AMD Radeon RX 6800 XT, 16 GB VRAM * Agent framework: DeepSeek Harness * Tool mode: PTC (run_code) Observed behavior: In PTC mode, DSH exposes run_code as the callable tool, with other tools accessible through the generated TypeScript SDK. However, Qwen intermittently attempts to invoke those underlying tools directly, producing output such as: <tool_call> <function=read> <parameter=file_path>decomp/ASSESSMENT.md</parameter> </function> </tool_call> Instead of invoking run_code with the appropriate SDK call: const result = await tools.read({ file_path: "decomp/ASSESSMENT.md" }); console.log(result); The incorrect invocation appears as raw XML in the conversation rather than being handled as a structured tool call that DSH can reject and provide feedback on. Interestingly, manually correcting the model works temporarily. After explicitly explaining the PTC calling convention, Qwen resumes using run_code correctly and can continue executing tools autonomously. However, after further execution, it eventually reverts to direct XML-style tool calls, causing the same failure again. This suggests two separate problems: 1. The model occasionally fails to follow the PTC calling convention. 2. The inference server / harness integration does not provide a reliable recovery path when the model attempts an undeclared tool call. I understand the reasoning behind restricting structured tool calls to explicitly declared tools, but an opt-in mechanism such as the proposed undeclared_tool_calls: "call" option would be extremely useful for agent frameworks that already implement their own tool validation. It would allow DSH to reject invalid calls and return actionable feedback to the model, rather than leaving raw XML in the conversation and potentially terminating an otherwise productive autonomous session. I support making this behavior configurable while retaining the current strict behavior as the default. Happy to provide additional logs or test a proposed fix if useful. — Reply to this email directly, view it on GitHub<https://github.com/Niko1221/Strata/issues/4622?email_source=notifications&email_token=AESFMY2F5YUF5Y6VLI4OTGL5XJMYBA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTMNRRG4ZDIMJVHE32M4TFMFZW63VHMNXW23LFNZ2KKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-6617241597>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AESFMYYU3X3PCKBUZSXTFRT5XJMYBAVCNFSNUABGKJSXA33TNF2G64TZHMYTGOBVHE2DMMZQGE5US43TOVSTWNRRGAZTCOBZG4ZDFILWAI>. You are receiving this because you commented.Message ID: ***@***.***>
Author
Owner

@marksmeltzer commented on GitHub (Nov 3, 2026):

I have a convention where my agents keep track of their bad tool calls and then do periodic RCAs to improve the system instructions over time. Self healing is the goal.

Regards,


From: Mark Smeltzer (Living Agile) @.>
Sent: Tuesday, 03 November 2026 15:20:19
To: Niko1221/Strata @.
>; Niko1221/Strata @.>
Cc: Comment @.
>
Subject: Re: [Niko1221/Strata] [Engine] Let the harness decide undeclared tool-call names: add a switch and a non-terminal refusal (Issue #4622)

That’s exactly right.

However, have you tried adding some global instructions that are always resident and survive compaction about the DSH calling convention? Whenever it messes up, you can ask your agent to do an RCA and improve those global instructions.

Even with error handling, this will still improve your workflow to get the agent issuing the calls correctly more often.

Regards,


From: macmmm81 @.>
Sent: Tuesday, 03 November 2026 14:36:48
To: Niko1221/Strata @.
>
Cc: Mark Smeltzer (Living Agile) @.>; Comment @.>
Subject: Re: [Niko1221/Strata] [Engine] Let the harness decide undeclared tool-call names: add a switch and a non-terminal refusal (Issue #4622)

[https://avatars.githubusercontent.com/u/39221755?s=20&v=4]macmmm81 left a comment (Niko1221/Strata#4622)https://github.com/Niko1221/Strata/issues/4622#issuecomment-6617241597

I can confirm experiencing this issue with Qwen 3.8 Flash-Next (ISTA IQ3_S) running through Strata 0.2.10 (build 0.1.56; python 3.12.15 ) + DeepSeek Harness (DSH) in Programmatic Tool Calling (PTC) mode.

Environment:

  • Model: Qwen 3.8 Flash-Next, ISTA IQ3_S GGUF
  • Inference server: Strata 0.2.10 (OpenAI-compatible API)
  • Hardware: AMD Radeon RX 6800 XT, 16 GB VRAM
  • Agent framework: DeepSeek Harness
  • Tool mode: PTC (run_code)

Observed behavior:

In PTC mode, DSH exposes run_code as the callable tool, with other tools accessible through the generated TypeScript SDK.

However, Qwen intermittently attempts to invoke those underlying tools directly, producing output such as:

<tool_call>
<function=read>
<parameter=file_path>decomp/ASSESSMENT.md

</tool_call>

Instead of invoking run_code with the appropriate SDK call:

const result = await tools.read({
file_path: "decomp/ASSESSMENT.md"
});
console.log(result);

The incorrect invocation appears as raw XML in the conversation rather than being handled as a structured tool call that DSH can reject and provide feedback on.

Interestingly, manually correcting the model works temporarily. After explicitly explaining the PTC calling convention, Qwen resumes using run_code correctly and can continue executing tools autonomously.

However, after further execution, it eventually reverts to direct XML-style tool calls, causing the same failure again.

This suggests two separate problems:

  1. The model occasionally fails to follow the PTC calling convention.
  2. The inference server / harness integration does not provide a reliable recovery path when the model attempts an undeclared tool call.

I understand the reasoning behind restricting structured tool calls to explicitly declared tools, but an opt-in mechanism such as the proposed undeclared_tool_calls: "call" option would be extremely useful for agent frameworks that already implement their own tool validation.

It would allow DSH to reject invalid calls and return actionable feedback to the model, rather than leaving raw XML in the conversation and potentially terminating an otherwise productive autonomous session.

I support making this behavior configurable while retaining the current strict behavior as the default.

Happy to provide additional logs or test a proposed fix if useful.

—
Reply to this email directly, view it on GitHubhttps://github.com/Niko1221/Strata/issues/4622?email_source=notifications&email_token=AESFMY2F5YUF5Y6VLI4OTGL5XJMYBA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTMNRRG4ZDIMJVHE32M4TFMFZW63VHMNXW23LFNZ2KKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-6617241597, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AESFMYYU3X3PCKBUZSXTFRT5XJMYBAVCNFSNUABGKJSXA33TNF2G64TZHMYTGOBVHE2DMMZQGE5US43TOVSTWNRRGAZTCOBZG4ZDFILWAI.
You are receiving this because you commented.Message ID: @.***>

<!-- gh-comment-id:6618021501 --> @marksmeltzer commented on GitHub (Nov 3, 2026): I have a convention where my agents keep track of their bad tool calls and then do periodic RCAs to improve the system instructions over time. Self healing is the goal. Regards, ________________________________ From: Mark Smeltzer (Living Agile) ***@***.***> Sent: Tuesday, 03 November 2026 15:20:19 To: Niko1221/Strata ***@***.***>; Niko1221/Strata ***@***.***> Cc: Comment ***@***.***> Subject: Re: [Niko1221/Strata] [Engine] Let the harness decide undeclared tool-call names: add a switch and a non-terminal refusal (Issue #4622) That’s exactly right. However, have you tried adding some global instructions that are always resident and survive compaction about the DSH calling convention? Whenever it messes up, you can ask your agent to do an RCA and improve those global instructions. Even with error handling, this will still improve your workflow to get the agent issuing the calls correctly more often. Regards, ________________________________ From: macmmm81 ***@***.***> Sent: Tuesday, 03 November 2026 14:36:48 To: Niko1221/Strata ***@***.***> Cc: Mark Smeltzer (Living Agile) ***@***.***>; Comment ***@***.***> Subject: Re: [Niko1221/Strata] [Engine] Let the harness decide undeclared tool-call names: add a switch and a non-terminal refusal (Issue #4622) [https://avatars.githubusercontent.com/u/39221755?s=20&v=4]macmmm81 left a comment (Niko1221/Strata#4622)<https://github.com/Niko1221/Strata/issues/4622#issuecomment-6617241597> I can confirm experiencing this issue with Qwen 3.8 Flash-Next (ISTA IQ3_S) running through Strata 0.2.10 (build 0.1.56; python 3.12.15 ) + DeepSeek Harness (DSH) in Programmatic Tool Calling (PTC) mode. Environment: * Model: Qwen 3.8 Flash-Next, ISTA IQ3_S GGUF * Inference server: Strata 0.2.10 (OpenAI-compatible API) * Hardware: AMD Radeon RX 6800 XT, 16 GB VRAM * Agent framework: DeepSeek Harness * Tool mode: PTC (run_code) Observed behavior: In PTC mode, DSH exposes run_code as the callable tool, with other tools accessible through the generated TypeScript SDK. However, Qwen intermittently attempts to invoke those underlying tools directly, producing output such as: <tool_call> <function=read> <parameter=file_path>decomp/ASSESSMENT.md</parameter> </function> </tool_call> Instead of invoking run_code with the appropriate SDK call: const result = await tools.read({ file_path: "decomp/ASSESSMENT.md" }); console.log(result); The incorrect invocation appears as raw XML in the conversation rather than being handled as a structured tool call that DSH can reject and provide feedback on. Interestingly, manually correcting the model works temporarily. After explicitly explaining the PTC calling convention, Qwen resumes using run_code correctly and can continue executing tools autonomously. However, after further execution, it eventually reverts to direct XML-style tool calls, causing the same failure again. This suggests two separate problems: 1. The model occasionally fails to follow the PTC calling convention. 2. The inference server / harness integration does not provide a reliable recovery path when the model attempts an undeclared tool call. I understand the reasoning behind restricting structured tool calls to explicitly declared tools, but an opt-in mechanism such as the proposed undeclared_tool_calls: "call" option would be extremely useful for agent frameworks that already implement their own tool validation. It would allow DSH to reject invalid calls and return actionable feedback to the model, rather than leaving raw XML in the conversation and potentially terminating an otherwise productive autonomous session. I support making this behavior configurable while retaining the current strict behavior as the default. Happy to provide additional logs or test a proposed fix if useful. — Reply to this email directly, view it on GitHub<https://github.com/Niko1221/Strata/issues/4622?email_source=notifications&email_token=AESFMY2F5YUF5Y6VLI4OTGL5XJMYBA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTMNRRG4ZDIMJVHE32M4TFMFZW63VHMNXW23LFNZ2KKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-6617241597>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AESFMYYU3X3PCKBUZSXTFRT5XJMYBAVCNFSNUABGKJSXA33TNF2G64TZHMYTGOBVHE2DMMZQGE5US43TOVSTWNRRGAZTCOBZG4ZDFILWAI>. You are receiving this because you commented.Message ID: ***@***.***>
Author
Owner

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

Part 1 is in v0.2.12: the config key undeclared_tool_calls ("text" by default, which is today's behaviour; "call" returns a well-formed call of an undeclared tool as tool_calls), also as STRATA_UNDECLARED_TOOL_CALLS=call, documented in docs/DETAILS.md (75acfca32).

Part 2 (a non-terminal signal on the default path) is not in this release, so this issue stays open for it.

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

<!-- gh-comment-id:6704755543 --> @Niko1221 commented on GitHub (Nov 7, 2026): Part 1 is in v0.2.12: the config key `undeclared_tool_calls` (`"text"` by default, which is today's behaviour; `"call"` returns a well-formed call of an undeclared tool as `tool_calls`), also as `STRATA_UNDECLARED_TOOL_CALLS=call`, documented in docs/DETAILS.md (75acfca32). Part 2 (a non-terminal signal on the default path) is not in this release, so this issue stays open for it. 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#2097
No description provided.