[GH-ISSUE #4751] [Engine] Tool calls emitted as text / rejected, breaking agent processing #2181

Open
opened 2026-11-04 01:57:17 +07:00 by bsakaguchi · 6 comments
Owner

Originally created by @FraYoshi on GitHub (Oct 30, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4751

Follow-up to #4427. That issue was closed, and couldn't reopen it, so this is filed as a new issue.

The problem

In PTC mode (Deepseek Harness) but not only limited to this harness, tool calls can come back to the agent as plain text instead of being executed. The agent run never completes, and the conversation is broken in an irreparable way most of the time. This still happens in the current build.
Last known working was version 0.1.45, unsure about more recent builds.

Steps to reproduce

  1. Build Strata and run with ./run-<model>.sh

  2. Set PTC mode (Deepseek Harness, DSH) in a new conversation.

  3. Run the agent through a long agentic Blender task with a prompt like this:

    I have added inside the measurements directory in angle-piece the measurements for the 3D model you have to make in Blender. The scope is 3D printing, and the 3D printed piece needs to lock on the angle by having a vertical piece on the bottom to not move, and a flat piece on the top to ultimately lock. Recreate the measured piece for reference, and as a separate object the one that will be printed. Do not recreate everything, only the angle of interest. The scope of the 3D piece to print is to not break the clothes when hurting the angle

  4. After a long multi-step session (1 turn, 22 steps, 710K tok), at some point instead of executing the tool, the model writes the tool call as literal text in the response:

        <tool_call>
          <function=tools.write>
            <parameter=file_path>/home/user/workspaces/blender/angle-piece-build/scratch/annot2.py</parameter>
            <parameter=content> ... python code ... </parameter>
          </function>
        </tool_call>
  1. The strata terminal logs the block as rejected instead of executed:
    [strata] 1 <tool_call> block(s) in the answer did not read as a call of a declared tool and went back as text (a name the request did not declare, or a form the template does not use); the names the model wrote: tools.write; the response carries them as strata_rejected_tool_calls, /metrics counts them

Expected vs actual

  • Expected: the tool call is executed, or at least the run stays recoverable.
  • Actual: the call is returned as text, the response never arrives, and the conversation is irreparably broken most of the time.

Other cases from the mother issue

Another user reports the tool call appearing in the response without the tool being called, in two shapes copied from the response body in llama-swap chat format: a call with the wrong parameter name (<parameter=input> on run_command), and a call prefixed with trailing text (Response <tool_call>...).

Environment

  • Strata version: strata 0.2.8 (build 0.1.54; python 3.14.8 at /usr/bin/python3)
  • DSH version 0.2.1-rc.2, PTC mode
  • Graphic card: RTX 3060 (12 GB VRAM), RAM 128 GB, Operating System: Arch Linux
Originally created by @FraYoshi on GitHub (Oct 30, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4751 Follow-up to #4427. That issue was closed, and couldn't reopen it, so this is filed as a new issue. ## The problem In PTC mode (Deepseek Harness) but not only limited to this harness, tool calls can come back to the agent as plain text instead of being executed. The agent run never completes, and the conversation is broken in an irreparable way most of the time. This still happens in the current build. Last known working was version `0.1.45`, unsure about more recent builds. ## Steps to reproduce 1. Build Strata and run with `./run-<model>.sh` 2. Set PTC mode (Deepseek Harness, DSH) in a new conversation. 3. Run the agent through a long agentic Blender task with a prompt like this: I have added inside the `measurements` directory in `angle-piece` the measurements for the 3D model you have to make in Blender. The scope is 3D printing, and the 3D printed piece needs to lock on the angle by having a vertical piece on the bottom to not move, and a flat piece on the top to ultimately lock. Recreate the measured piece for reference, and as a separate object the one that will be printed. Do not recreate everything, only the angle of interest. The scope of the 3D piece to print is to not break the clothes when hurting the angle 4. After a long multi-step session (1 turn, 22 steps, 710K tok), at some point instead of executing the tool, the model writes the tool call as literal text in the response: ``` <tool_call> <function=tools.write> <parameter=file_path>/home/user/workspaces/blender/angle-piece-build/scratch/annot2.py</parameter> <parameter=content> ... python code ... </parameter> </function> </tool_call> ``` 5. The strata terminal logs the block as rejected instead of executed: `[strata] 1 <tool_call> block(s) in the answer did not read as a call of a declared tool and went back as text (a name the request did not declare, or a form the template does not use); the names the model wrote: tools.write; the response carries them as strata_rejected_tool_calls, /metrics counts them` ## Expected vs actual - **Expected:** the tool call is executed, or at least the run stays recoverable. - **Actual:** the call is returned as text, the response never arrives, and the conversation is irreparably broken most of the time. ## Other cases from the mother issue Another user reports the tool call appearing in the response without the tool being called, in two shapes copied from the response body in llama-swap chat format: a call with the wrong parameter name (`<parameter=input>` on `run_command`), and a call prefixed with trailing text (`Response <tool_call>...`). ## Environment - [x] Strata version: `strata 0.2.8 (build 0.1.54; python 3.14.8 at /usr/bin/python3)` - [x] `DSH` version `0.2.1-rc.2`, `PTC mode` - [x] Graphic card: RTX 3060 (12 GB VRAM), RAM 128 GB, Operating System: Arch Linux
Author
Owner

@github-actions[bot] commented on GitHub (Oct 30, 2026):

Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:

  • Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes".

Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment /reopen.

Details: CONTRIBUTING.md

<!-- gh-comment-id:6534453362 --> @github-actions[bot] commented on GitHub (Oct 30, 2026): Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing: - [ ] Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes". Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment `/reopen`. Details: [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md)
Author
Owner

@github-actions[bot] commented on GitHub (Oct 30, 2026):

Thanks, this follows the format now.

<!-- gh-comment-id:6534486759 --> @github-actions[bot] commented on GitHub (Oct 30, 2026): Thanks, this follows the format now.
Author
Owner

@miscdebris commented on GitHub (Oct 31, 2026):

Environment

  • Strata version: strata 0.2.9 (build 0.1.55; docker cuda 13), qwen3.8-flash-next-iq3_s
  • OpenWebUI 0.12.5
  • NVIDIA GeForce RTX 3090 + NVIDIA GeForce RTX 3090, 48 GB

I had a prompt running with dozens of tool calls, and initially it look good, but at the end tool calls ended up again in response:

Actually, let me do parallel: get emails 3889, 6872, 7328, and search for pptx.

Then download attachments.

Let me do that.

Response

Ich habe die Kernfäden identifiziert. Jetzt hole ich die restlichen Details und lade die Anhänge herunter.<tool_call>
<function=run_command>
<parameter=command>
ls -la /home/user/ 2>&1 | head -30; echo "---"; ls -la /home/user/imap-attachments/ 2>&1 | head -20
</parameter>
</function>
</tool_call>
Let me also verify the folder.

Response

<tool_call>
<function=run_command>
<parameter=command>
ls -la /home/user/imap-attachments/
</parameter>
</function>
</tool_call>
Let me verify the download folder and download the eml attachments.

Response

<tool_call>
<function=run_command>
<parameter=command>
ls -la /home/user/imap-attachments/ 2>&1
</parameter>
</function>
</tool_call>
<!-- gh-comment-id:6544981831 --> @miscdebris commented on GitHub (Oct 31, 2026): Environment - [X] Strata version: strata 0.2.9 (build 0.1.55; docker cuda 13), qwen3.8-flash-next-iq3_s - [X] OpenWebUI 0.12.5 - [X] NVIDIA GeForce RTX 3090 + NVIDIA GeForce RTX 3090, 48 GB I had a prompt running with dozens of tool calls, and initially it look good, but at the end tool calls ended up again in response: ``` Actually, let me do parallel: get emails 3889, 6872, 7328, and search for pptx. Then download attachments. Let me do that. Response Ich habe die Kernfäden identifiziert. Jetzt hole ich die restlichen Details und lade die Anhänge herunter.<tool_call> <function=run_command> <parameter=command> ls -la /home/user/ 2>&1 | head -30; echo "---"; ls -la /home/user/imap-attachments/ 2>&1 | head -20 </parameter> </function> </tool_call> ``` ``` Let me also verify the folder. Response <tool_call> <function=run_command> <parameter=command> ls -la /home/user/imap-attachments/ </parameter> </function> </tool_call> ``` ``` Let me verify the download folder and download the eml attachments. Response <tool_call> <function=run_command> <parameter=command> ls -la /home/user/imap-attachments/ 2>&1 </parameter> </function> </tool_call> ```
Author
Owner

@miscdebris commented on GitHub (Nov 4, 2026):

Environment

  • Strata version: strata 0.2.10 (build 0.1.56; self created docker cuda 13), qwen3.8-flash-next-iq3_s
  • OpenWebUI 0.13.0
  • NVIDIA GeForce RTX 3090 + NVIDIA GeForce RTX 3090, 48 GB

At first I thought it is fixed, since there I had chats with dozens and dozens of tools calls, all no problem. Then basically right at start of a chat the tools calls again made it into the response.

[thinking]...
Today is 2026-11-04. "Ein paar Jahre alt" — so maybe 2022-2024. Let's search subject "KMC" in XXX-Engineering without date limits but small limit? Rule says keep bounds. But subject search is cheap. Let me do subject "KMC" in the Engineering folder, limit 25.

Response

<tool_call>
<function=tool_list_messages_post>
<parameter=mailbox>
XXX/Outlook Outlook-Datendatei/XXX-Engineering {5F}
</parameter>
<parameter=subject>
KMC
</parameter>
<parameter=limit>
25
</parameter>
</function>
[thinking]...
Actually careful: bundling one IMAP call is fine.

Response

Ordnerliste liegt vor. Ich suche jetzt ordnerweise, beginnend beim wahrscheinlichsten Ordner.<tool_call>
<function=tool_list_messages_post>
<parameter=mailbox>
XXX/Outlook Outlook-Datendatei/XXX-Engineering {5F}
</parameter>
<parameter=subject>
KMC
</parameter>
<parameter=limit>
25
</parameter>
</function>
</tool_call>
<!-- gh-comment-id:6641197934 --> @miscdebris commented on GitHub (Nov 4, 2026): Environment - [X] Strata version: strata 0.2.10 (build 0.1.56; self created docker cuda 13), qwen3.8-flash-next-iq3_s - [X] OpenWebUI 0.13.0 - [X] NVIDIA GeForce RTX 3090 + NVIDIA GeForce RTX 3090, 48 GB At first I thought it is fixed, since there I had chats with dozens and dozens of tools calls, all no problem. Then basically right at start of a chat the tools calls again made it into the response. ``` [thinking]... Today is 2026-11-04. "Ein paar Jahre alt" — so maybe 2022-2024. Let's search subject "KMC" in XXX-Engineering without date limits but small limit? Rule says keep bounds. But subject search is cheap. Let me do subject "KMC" in the Engineering folder, limit 25. Response <tool_call> <function=tool_list_messages_post> <parameter=mailbox> XXX/Outlook Outlook-Datendatei/XXX-Engineering {5F} </parameter> <parameter=subject> KMC </parameter> <parameter=limit> 25 </parameter> </function> ``` ``` [thinking]... Actually careful: bundling one IMAP call is fine. Response Ordnerliste liegt vor. Ich suche jetzt ordnerweise, beginnend beim wahrscheinlichsten Ordner.<tool_call> <function=tool_list_messages_post> <parameter=mailbox> XXX/Outlook Outlook-Datendatei/XXX-Engineering {5F} </parameter> <parameter=subject> KMC </parameter> <parameter=limit> 25 </parameter> </function> </tool_call> ```
Author
Owner

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

Strata 0.2.11 fixes the forms in this report: a call written as tools.write, functions.write or default_api.write now runs your declared write tool. The space form (tools write) and a bare tools are tracked in #5409. Could you try your setup on 0.2.11 and say whether it works? I'll close this once it does.

<!-- gh-comment-id:6694474954 --> @Niko1221 commented on GitHub (Nov 6, 2026): Strata 0.2.11 fixes the forms in this report: a call written as `tools.write`, `functions.write` or `default_api.write` now runs your declared `write` tool. The space form (`tools write`) and a bare `tools` are tracked in #5409. Could you try your setup on 0.2.11 and say whether it works? I'll close this once it does.
Author
Owner

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

Thanks for the attempt @Niko1221 , unfortunately the problem persists.

Here my report (with the 3 full sessions attached in the zip file)

261107-dsh-sessions.zip

Strata version 0.2.11, testing with Qwen3.8-flash-next iq4_xs by Unsloth.

Tests are made using dsh in PTC mode, medium reasoning

config:

{
 "exe": "/redacted/path/strata",
 "args": [
  "--pack",
  "/redacted/path/unsloth-ud-iq4_xs",
  "--native",
  "/redacted/path/Qwen3.8-Flash-Next-UD-IQ4_XS-00001-of-00003.gguf",
  "--expert-profile",
  "/redacted/path/expert-profile.bin",
  "--expert-cache",
  "auto",
  "--prefill",
  "auto",
  "--spec",
  "4",
  "--mtp",
  "/redacted/path/rt",
  "--max-context",
  "262144",
  "--kv",
  "int8",
  "--kv-resident",
  "32768",
  "--resident-budget-gib",
  "55",
  "--vision",
  "--vram-reserve-mib",
  "700",
  "--spec-min-p",
  "0.5"
 ],
 "cwd": "/redacted/path/strata",
 "tokenizer": "/redacted/path/tokenizer",
 "model_name": "qwen3.8-flash-next-unsloth-ud-iq4_xs",
 "log": "/redacted/path/strata-unsloth-ud-iq4_xs.log",
 "lib_dirs": [
  "/redacted/path/bin",
  "/redacted/path/lib64"
 ],
 "port": "<redacted>",
 "gpu": 0,
 "gpus_asked": true,
 "fit_max_tokens": true,
 "vision": {
  "exe": "/redacted/path/strata-vision",
  "mmproj": "/redacted/path/mmproj-Qwen3.8-Flash-Next-BF16.gguf",
  "model": "/redacted/path/Qwen3.8-Flash-Next-UD-IQ4_XS-00001-of-00003.gguf",
  "gpu": false,
  "cpu": true,
  "max_tokens": 300,
  "threads": 12
 },
   "drafting": "dflash2",
 "env": {
     "STRATA_ROUTE_PRIOR": "1.5"
 }
}

prompt:

You have access to the Blender executable, create a realistic 3D model of a whale that can be 3D printed

1st test (1.5 engine - DFlash2)

session: session-7e7c90c7-9cf8-4f97-aedf-daae5bb44699

Conversation stopped with this ending: </parameter> </function> </tool_call>
after 1 turn, 2 steps, 47.3K tokens

from the command line log:

[strata] done: 18647 tokens in 406 s (46.5 tok/s) (stop, cancel=False), expert cache 91.2% hit (+0.6% of the routed experts over PCIe)
[strata] 1 <tool_call> block(s) in the answer did not read as a call of a declared tool and went back as text (a name the request did not declare, or a form the template does not use); the names the model wrote: write; the response carries them as strata_rejected_tool_calls, /metrics counts them

2nd test (mainline engine - DFlash2)

session: session-5f990bb9-a6f5-4ab0-8135-caeceb05e262

Conversation stopped with this ending: </parameter> </function> </tool_call>
after 1 turn, 5 steps, 173K tokens

from the command line logs:

[strata] done: 27021 tokens in 717 s (37.8 tok/s) (stop, cancel=False), expert cache 65.8% hit (+6.4% of the routed experts over PCIe)
[strata] 1 <tool_call> block(s) in the answer did not read as a call of a declared tool and went back as text (a name the request did not declare, or a form the template does not use); the names the model wrote: write; the response carries them as strata_rejected_tool_calls, /metrics counts them

3rd test (mainline engine - MTP)

session: session-24e80725-6b40-458f-b206-8161a7d46c86

At turn 1, step 4, conversation answered with <tool_call> <function=read> <parameter=file_path> /redacted/path/tmp_probe_api.py </parameter> </function> </tool_call> but did not stop.
from the command line log:

[strata] done: 2996 tokens in 108 s (33.1 tok/s) (stop, cancel=False), expert cache 63.5% hit (+6.5% of the routed experts over PCIe)
[strata] 1 <tool_call> block(s) in the answer did not read as a call of a declared tool and went back as text (a name the request did not declare, or a form the template does not use); the names the model wrote: read; the response carries them as strata_rejected_tool_calls, /metrics counts them
[strata] reading the prompt: 32,947 of 32,952 tokens, 6 s so far

At turn 1, step 7, 257K tokens, conversation stopped with </parameter> </function> </tool_call>

from the command line log:

[strata] done: 8877 tokens in 241 s (45.2 tok/s) (stop, cancel=False), expert cache 65.0% hit (+6.9% of the routed experts over PCIe)
[strata] 1 <tool_call> block(s) in the answer did not read as a call of a declared tool and went back as text (a name the request did not declare, or a form the template does not use); the names the model wrote: write; the response carries them as strata_rejected_tool_calls, /metrics counts them
<!-- gh-comment-id:6701925039 --> @FraYoshi commented on GitHub (Nov 7, 2026): Thanks for the attempt @Niko1221 , unfortunately the problem persists. Here my report (with the 3 full sessions attached in the zip file) [261107-dsh-sessions.zip](https://github.com/user-attachments/files/34509498/261107-dsh-sessions.zip) Strata version `0.2.11`, testing with Qwen3.8-flash-next `iq4_xs` by Unsloth. Tests are made using `dsh` in `PTC mode`, medium reasoning config: ```json { "exe": "/redacted/path/strata", "args": [ "--pack", "/redacted/path/unsloth-ud-iq4_xs", "--native", "/redacted/path/Qwen3.8-Flash-Next-UD-IQ4_XS-00001-of-00003.gguf", "--expert-profile", "/redacted/path/expert-profile.bin", "--expert-cache", "auto", "--prefill", "auto", "--spec", "4", "--mtp", "/redacted/path/rt", "--max-context", "262144", "--kv", "int8", "--kv-resident", "32768", "--resident-budget-gib", "55", "--vision", "--vram-reserve-mib", "700", "--spec-min-p", "0.5" ], "cwd": "/redacted/path/strata", "tokenizer": "/redacted/path/tokenizer", "model_name": "qwen3.8-flash-next-unsloth-ud-iq4_xs", "log": "/redacted/path/strata-unsloth-ud-iq4_xs.log", "lib_dirs": [ "/redacted/path/bin", "/redacted/path/lib64" ], "port": "<redacted>", "gpu": 0, "gpus_asked": true, "fit_max_tokens": true, "vision": { "exe": "/redacted/path/strata-vision", "mmproj": "/redacted/path/mmproj-Qwen3.8-Flash-Next-BF16.gguf", "model": "/redacted/path/Qwen3.8-Flash-Next-UD-IQ4_XS-00001-of-00003.gguf", "gpu": false, "cpu": true, "max_tokens": 300, "threads": 12 }, "drafting": "dflash2", "env": { "STRATA_ROUTE_PRIOR": "1.5" } } ``` prompt: > You have access to the Blender executable, create a realistic 3D model of a whale that can be 3D printed # 1st test (1.5 engine - DFlash2) session: `session-7e7c90c7-9cf8-4f97-aedf-daae5bb44699` Conversation stopped with this ending: `</parameter> </function> </tool_call>` after 1 turn, 2 steps, 47.3K tokens from the command line log: ``` [strata] done: 18647 tokens in 406 s (46.5 tok/s) (stop, cancel=False), expert cache 91.2% hit (+0.6% of the routed experts over PCIe) [strata] 1 <tool_call> block(s) in the answer did not read as a call of a declared tool and went back as text (a name the request did not declare, or a form the template does not use); the names the model wrote: write; the response carries them as strata_rejected_tool_calls, /metrics counts them ``` # 2nd test (mainline engine - DFlash2) session: `session-5f990bb9-a6f5-4ab0-8135-caeceb05e262` Conversation stopped with this ending: `</parameter> </function> </tool_call>` after 1 turn, 5 steps, 173K tokens from the command line logs: ``` [strata] done: 27021 tokens in 717 s (37.8 tok/s) (stop, cancel=False), expert cache 65.8% hit (+6.4% of the routed experts over PCIe) [strata] 1 <tool_call> block(s) in the answer did not read as a call of a declared tool and went back as text (a name the request did not declare, or a form the template does not use); the names the model wrote: write; the response carries them as strata_rejected_tool_calls, /metrics counts them ``` # 3rd test (mainline engine - MTP) session: `session-24e80725-6b40-458f-b206-8161a7d46c86` At turn 1, step 4, conversation answered with `<tool_call> <function=read> <parameter=file_path> /redacted/path/tmp_probe_api.py </parameter> </function> </tool_call>` but did not stop. from the command line log: ``` [strata] done: 2996 tokens in 108 s (33.1 tok/s) (stop, cancel=False), expert cache 63.5% hit (+6.5% of the routed experts over PCIe) [strata] 1 <tool_call> block(s) in the answer did not read as a call of a declared tool and went back as text (a name the request did not declare, or a form the template does not use); the names the model wrote: read; the response carries them as strata_rejected_tool_calls, /metrics counts them [strata] reading the prompt: 32,947 of 32,952 tokens, 6 s so far ``` At turn 1, step 7, 257K tokens, conversation stopped with `</parameter> </function> </tool_call>` from the command line log: ``` [strata] done: 8877 tokens in 241 s (45.2 tok/s) (stop, cancel=False), expert cache 65.0% hit (+6.9% of the routed experts over PCIe) [strata] 1 <tool_call> block(s) in the answer did not read as a call of a declared tool and went back as text (a name the request did not declare, or a form the template does not use); the names the model wrote: write; the response carries them as strata_rejected_tool_calls, /metrics counts them ```
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#2181
No description provided.