mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #5225] [Engine] tool-call arguments intermittently corrupted with copied schema text; STRATA_ROUTE_TAIL_SKIP=0 stops it #3110
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#3110
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 7What happened:
tool_calls[].function.argumentsintermittently returns valid JSON whose value is corrupted with text copied verbatim from the tool schema — the declared enum list concatenated:(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:
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=7skips 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; theSTRATA_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
#267crash (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) withROUTE_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.logexcerpt around the garbage run available on request (sanitized).@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:
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
@github-actions[bot] commented on GitHub (Nov 4, 2026):
Thanks, this follows the format now.
@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).
STRATA_ROUTE_TAIL_SKIP=0and 17 on stock defaults (ROUTE_TAIL_SKIP=7 is ONbanner verified).ROUTE_TAIL_SKIP=0workaround for now and will follow up after more real-world use.@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:
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 ONline from the previous engine session (my grep window spanned both sessions). The engine serving those 17 runs was in fact still running withSTRATA_ROUTE_TAIL_SKIP=0. So stock 0.1.57 has not been tested; sorry for the noise.The corruption still occurs at agent scale with
ROUTE_TAIL_SKIP=0active. 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):Observed artifacts in that session (all on the assistant tool_calls):
writearguments 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.read {}(empty arguments) several times;write {"path": "", "content": "// placeholder\n"}.writewhosepathaccumulated 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.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).
@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