[GH-ISSUE #5225] [Engine] tool-call arguments intermittently corrupted with copied schema text; STRATA_ROUTE_TAIL_SKIP=0 stops it #3110

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

Originally created by @sauris on GitHub (Nov 4, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5225

Area: [Engine] (speed, kernels, models, the server and API)

Desktop app, Terminal or source? Desktop app (Windows)

Strata version: Strata 0.2.10 · engine 0.1.56 (windows-x86_64-hip-rx9070)

Graphics card, memory and system: AMD Radeon AI PRO R9700 32 GB · 128 GB RAM · Windows 11

Model, size and settings: Qwen3.8-Flash-Next IQ3_S (GSQ-RCO) · 128K context · pictures on · --spec 4 --spec-min-p 0.5 --mtp mtp/rt --expert-cache auto --prefill auto --kv int8 --kv-resident 32768 --pool-workers 7

What happened:

tool_calls[].function.arguments intermittently returns valid JSON whose value is corrupted with text copied verbatim from the tool schema — the declared enum list concatenated:

{"city": "Perth, Western Australia", "unit": "celsius_celsius_celsius_celsius_celsius_fahrenheit_fahrenheit_fahrenheit_fahrenheit_fahrenheit_kelvin_kelvin_kelvin_kelvin_kelvin_C_C_C_C_F_F_F_K_K_mph_kmh_knots_m_s_ft_s_mi_h_km_h_nmi_msftsmhkmhknotskmh"}

(schema declares "unit": {"enum": ["celsius", "fahrenheit", "kelvin", "C", "F", "K", "mph", "km/h", ...]})

Expected: the value contains only what the model intends, e.g. "unit": "celsius".

Actual: ~6% of scripted tool-calling requests at temperature: 0; also hit real multi-tool agent sessions. The same byte-identical request alternates clean/garbage, so the state is not sampler-driven. Garbage appeared only on cache-hot repeats (prompt 414 tokens = 409 reused + 5 read).

Engine-log fingerprint on a garbage reply:

strata serve: prompt 414 tokens = 409 reused + 5 read in 74 ms (67.3 tok/s), 190 generated in 5718 ms (33.2 tok/s), drafts accepted 82 of 186, 1 checkpoints
strata serve: suffix drafts: 8 windows, 12 of 17 drafts accepted

Clean replies on the identical prompt draft 50–110 tokens. The garbage is verbatim tools-block text, so the suffix drafter appears to propose copied schema spans and the verify pass accepts them. Suspected contributor (static reading, not proven): STRATA_ROUTE_TAIL_SKIP=7 skips experts inside the verify window, so verify logits differ from decode logits.

Smallest steps or command that reproduce it:

Scripted probe: POST /v1/chat/completions, two function tools (one with an enum parameter), temperature: 0, tool_choice: "auto", repeated ~17 times with identical payloads → 1 hard corruption + 1 milder whitespace artifact in the first 17 requests. Stdlib-python probe script available, runs against the local API.

Reproduction status: Reproduced locally — and the mitigation is verified live: with STRATA_ROUTE_TAIL_SKIP=0 (user env var, full restart; the STRATA_ROUTE_TAIL_SKIP=7 is ON (default) banner disappears), 0 copied-schema garbage in 32 scripted requests across two engine starts. Cost: the advertised 10–20% decode on expert-miss workloads.

Also observed in the same battery: the #267 crash (Unrecoverable native verification failure: verify: timed out at layer 29 ... GPU did not finish within 5 s) still fired once (HTTP 503, engine auto-restart) with ROUTE_TAIL_SKIP=0 — so that crash is independent of tail-skip.

Prior art of the same failure class in other engines: vLLM #40875 (ngram drafter copies tool-schema text → corrupted Qwen3 tool calls), vLLM #56077 (ngram speculation corrupts qwen3_coder tool-call arguments; MTP-only clean), vLLM #50188 (prefix-cached repeats corrupt tool-call emission; first-time prompts clean).

Full strata-iq3_s.log excerpt around the garbage run available on request (sanitized).

Originally created by @sauris on GitHub (Nov 4, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/5225 **Area:** [Engine] (speed, kernels, models, the server and API) **Desktop app, Terminal or source?** Desktop app (Windows) **Strata version:** Strata 0.2.10 · engine 0.1.56 (windows-x86_64-hip-rx9070) **Graphics card, memory and system:** AMD Radeon AI PRO R9700 32 GB · 128 GB RAM · Windows 11 **Model, size and settings:** Qwen3.8-Flash-Next IQ3_S (GSQ-RCO) · 128K context · pictures on · `--spec 4 --spec-min-p 0.5 --mtp mtp/rt --expert-cache auto --prefill auto --kv int8 --kv-resident 32768 --pool-workers 7` **What happened:** `tool_calls[].function.arguments` intermittently returns valid JSON whose value is corrupted with text copied verbatim from the tool schema — the declared enum list concatenated: ```json {"city": "Perth, Western Australia", "unit": "celsius_celsius_celsius_celsius_celsius_fahrenheit_fahrenheit_fahrenheit_fahrenheit_fahrenheit_kelvin_kelvin_kelvin_kelvin_kelvin_C_C_C_C_F_F_F_K_K_mph_kmh_knots_m_s_ft_s_mi_h_km_h_nmi_msftsmhkmhknotskmh"} ``` (schema declares `"unit": {"enum": ["celsius", "fahrenheit", "kelvin", "C", "F", "K", "mph", "km/h", ...]}`) Expected: the value contains only what the model intends, e.g. `"unit": "celsius"`. Actual: ~6% of scripted tool-calling requests at `temperature: 0`; also hit real multi-tool agent sessions. The same byte-identical request alternates clean/garbage, so the state is not sampler-driven. Garbage appeared only on cache-hot repeats (`prompt 414 tokens = 409 reused + 5 read`). Engine-log fingerprint on a garbage reply: ``` strata serve: prompt 414 tokens = 409 reused + 5 read in 74 ms (67.3 tok/s), 190 generated in 5718 ms (33.2 tok/s), drafts accepted 82 of 186, 1 checkpoints strata serve: suffix drafts: 8 windows, 12 of 17 drafts accepted ``` Clean replies on the identical prompt draft 50–110 tokens. The garbage is verbatim tools-block text, so the suffix drafter appears to propose copied schema spans and the verify pass accepts them. Suspected contributor (static reading, not proven): `STRATA_ROUTE_TAIL_SKIP=7` skips experts *inside the verify window*, so verify logits differ from decode logits. **Smallest steps or command that reproduce it:** Scripted probe: `POST /v1/chat/completions`, two function tools (one with an enum parameter), `temperature: 0`, `tool_choice: "auto"`, repeated ~17 times with identical payloads → 1 hard corruption + 1 milder whitespace artifact in the first 17 requests. Stdlib-python probe script available, runs against the local API. **Reproduction status:** Reproduced locally — and the mitigation is verified live: with `STRATA_ROUTE_TAIL_SKIP=0` (user env var, full restart; the `STRATA_ROUTE_TAIL_SKIP=7 is ON (default)` banner disappears), **0 copied-schema garbage in 32 scripted requests** across two engine starts. Cost: the advertised 10–20% decode on expert-miss workloads. Also observed in the same battery: the `#267` crash (`Unrecoverable native verification failure: verify: timed out at layer 29 ... GPU did not finish within 5 s`) still fired once (HTTP 503, engine auto-restart) *with* `ROUTE_TAIL_SKIP=0` — so that crash is independent of tail-skip. Prior art of the same failure class in other engines: vLLM #40875 (ngram drafter copies tool-schema text → corrupted Qwen3 tool calls), vLLM #56077 (ngram speculation corrupts qwen3_coder tool-call arguments; MTP-only clean), vLLM #50188 (prefix-cached repeats corrupt tool-call emission; first-time prompts clean). Full `strata-iq3_s.log` excerpt around the garbage run available on request (sanitized).
Author
Owner

@github-actions[bot] commented on GitHub (Nov 4, 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:6634856180 --> @github-actions[bot] commented on GitHub (Nov 4, 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 (Nov 4, 2026):

Thanks, this follows the format now.

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

@sauris commented on GitHub (Nov 5, 2026):

Update after upgrading to Strata 0.2.11 / engine 0.1.57: re-ran the same scripted 2-tool probe (temperature 0, identical payloads).

  • 42 requests total, 0 copied-schema garbage — 25 with STRATA_ROUTE_TAIL_SKIP=0 and 17 on stock defaults (ROUTE_TAIL_SKIP=7 is ON banner verified).
  • On 0.1.56 stock the same probe produced hard corruption within ~17 requests, so this looks improved — but 17 stock runs on 0.1.57 can't statistically rule out a low residual rate (p≈0.35 if the old 6% rate persisted). I'm keeping the ROUTE_TAIL_SKIP=0 workaround for now and will follow up after more real-world use.
  • Separately, the whitespace-in-parameter artifact from #5226 still reproduces on 0.1.57 stock (1/17).
<!-- gh-comment-id:6661284142 --> @sauris commented on GitHub (Nov 5, 2026): Update after upgrading to **Strata 0.2.11 / engine 0.1.57**: re-ran the same scripted 2-tool probe (temperature 0, identical payloads). - **42 requests total, 0 copied-schema garbage** — 25 with `STRATA_ROUTE_TAIL_SKIP=0` and 17 on stock defaults (`ROUTE_TAIL_SKIP=7 is ON` banner verified). - On 0.1.56 stock the same probe produced hard corruption within ~17 requests, so this looks improved — but 17 stock runs on 0.1.57 can't statistically rule out a low residual rate (p≈0.35 if the old 6% rate persisted). I'm keeping the `ROUTE_TAIL_SKIP=0` workaround for now and will follow up after more real-world use. - Separately, the whitespace-in-parameter artifact from #5226 still reproduces on 0.1.57 stock (1/17).
Author
Owner

@sauris commented on GitHub (Nov 5, 2026):

Correction to my earlier update + real-workload evidence (Strata 0.2.11 / engine 0.1.57).

Two fixes to what I wrote above:

  1. My "17 stock-default runs were clean" datapoint was invalid. The banner check I used to confirm stock state matched a ROUTE_TAIL_SKIP=7 is ON line from the previous engine session (my grep window spanned both sessions). The engine serving those 17 runs was in fact still running with STRATA_ROUTE_TAIL_SKIP=0. So stock 0.1.57 has not been tested; sorry for the noise.

  2. The corruption still occurs at agent scale with ROUTE_TAIL_SKIP=0 active. During a real opencode coding session (~50 min, 66 tool calls) against this same engine, the requests were ~98K–106K tokens (cache-hot: 98220 of 98572 reused etc.), and the per-request draft volumes were enormous compared to my small-probe baseline (50–110 proposals):

prompt 101677 tokens = 101241 reused + 436 read ... 733 generated ... drafts accepted 476 of 797
prompt 100083 tokens =  99976 reused + 107 read ... 673 generated ... drafts accepted 387 of 785
prompt  99430 tokens =  99366 reused +  64 read ... 547 generated ... drafts accepted 296 of 671

Observed artifacts in that session (all on the assistant tool_calls):

  • Large write arguments truncating mid-generation, repeatedly, at shrinking lengths (a ~2 KB source file write cut off mid-token; retries truncated earlier each time) — the model itself concluded "Confirmed a call-size limit" and fell back to chunked shell heredoc writes.
  • Degenerate calls: read {} (empty arguments) several times; write {"path": "", "content": "// placeholder\n"}.
  • Copied/garbled path arguments: a write whose path accumulated context fragments — "scripts/cert-der.mjs.txt.mdstyle-dummy-ignore-if-missing-path-C:\\Mia.Cervantez\\AppData\\npm-cache\\sandbox..." including an invented username that exists nowhere on the machine — consistent with suffix-draft copying of path-like strings from the prompt context.
  • Fused paths: read {"path": "C:\\<workdir>\\C:\\Users\\<user>\\..."} (two absolute paths concatenated).

So at ~100K-token agent contexts the suffix drafter proposes hundreds of tokens per request and copied/context-garbage text still lands in arguments even with the tail-skip workaround — possibly interacting with the >28,672-token QSA block-scorer approximation (active in this regime). My earlier "0/32 with the workaround" conclusion only holds for small tool-calling requests; the workaround does not fully protect agent-scale sessions.

Happy to test any fix build the same way (the probe + this session's fingerprint are both reproducible: cache-hot ~100K-token prompts with draft proposals in the hundreds).

<!-- gh-comment-id:6662811649 --> @sauris commented on GitHub (Nov 5, 2026): **Correction to my earlier update + real-workload evidence (Strata 0.2.11 / engine 0.1.57).** Two fixes to what I wrote above: 1. **My "17 stock-default runs were clean" datapoint was invalid.** The banner check I used to confirm stock state matched a `ROUTE_TAIL_SKIP=7 is ON` line from the *previous* engine session (my grep window spanned both sessions). The engine serving those 17 runs was in fact still running with `STRATA_ROUTE_TAIL_SKIP=0`. So stock 0.1.57 has not been tested; sorry for the noise. 2. **The corruption still occurs at agent scale with `ROUTE_TAIL_SKIP=0` active.** During a real opencode coding session (~50 min, 66 tool calls) against this same engine, the requests were ~98K–106K tokens (cache-hot: 98220 of 98572 reused etc.), and the per-request draft volumes were enormous compared to my small-probe baseline (50–110 proposals): ``` prompt 101677 tokens = 101241 reused + 436 read ... 733 generated ... drafts accepted 476 of 797 prompt 100083 tokens = 99976 reused + 107 read ... 673 generated ... drafts accepted 387 of 785 prompt 99430 tokens = 99366 reused + 64 read ... 547 generated ... drafts accepted 296 of 671 ``` Observed artifacts in that session (all on the assistant tool_calls): - **Large `write` arguments truncating mid-generation**, repeatedly, at shrinking lengths (a ~2 KB source file write cut off mid-token; retries truncated earlier each time) — the model itself concluded "Confirmed a call-size limit" and fell back to chunked shell heredoc writes. - **Degenerate calls**: `read {}` (empty arguments) several times; `write {"path": "", "content": "// placeholder\n"}`. - **Copied/garbled path arguments**: a `write` whose `path` accumulated context fragments — `"scripts/cert-der.mjs.txt.mdstyle-dummy-ignore-if-missing-path-C:\\Mia.Cervantez\\AppData\\npm-cache\\sandbox..."` including an invented username that exists nowhere on the machine — consistent with suffix-draft copying of path-like strings from the prompt context. - **Fused paths**: `read {"path": "C:\\<workdir>\\C:\\Users\\<user>\\..."}` (two absolute paths concatenated). So at ~100K-token agent contexts the suffix drafter proposes hundreds of tokens per request and copied/context-garbage text still lands in arguments even with the tail-skip workaround — possibly interacting with the >28,672-token QSA block-scorer approximation (active in this regime). My earlier "0/32 with the workaround" conclusion only holds for small tool-calling requests; the workaround does not fully protect agent-scale sessions. Happy to test any fix build the same way (the probe + this session's fingerprint are both reproducible: cache-hot ~100K-token prompts with draft proposals in the hundreds).
Author
Owner

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

I've also brought this up in #5136

I am worried the maintainer does not have enough relevant experience to realize that having tail skip on by default is actually a bad idea

<!-- gh-comment-id:6688747108 --> @HelloItMeMort commented on GitHub (Nov 6, 2026): I've also brought this up in #5136 I am worried the maintainer does not have enough relevant experience to realize that having tail skip on by default is actually a bad idea
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#3110
No description provided.