#5756 [Engine] Tool-call value truncated when the model skips a parameter's own </parameter> after a nested pair (Qwen3.8-Flash-Next)
closed · @pg0 · 10 コメント · GitHub で見る
Setup & installServer & APINVIDIA / CUDAModels & quantsDocumentationWindowsLinux
本文
### Area
[Engine] (`serve/frontend.py`, tool-call parser)
### Reproduction status
Reproduced locally at parser level on `main` (dbb2d168), no model or GPU needed. Seen end to end with Qwen3.8-Flash-Next (ISTA GSQ-RCO IQ3_S, `strata-iq3_s.json`).
### Desktop app, Terminal or source?
Source (setup.sh / git checkout)
### Strata version
`v0.2.13.1-88-gdbb2d168` (main, dbb2d168). Parser-level repro also holds on 0.1.57 and 0.2.12 / 0.1.58 serve trees (see comment from udqe).
### Graphics card, memory and system
RTX 5090 32 GB (single GPU used) · 128 GB RAM · Ryzen 9 9950X · Windows 11 Pro + WSL2 Ubuntu 24.04, driver 621.14
### Model, size and settings
Qwen3.8-Flash-Next ISTA GSQ-RCO IQ3_S · `strata-iq3_s.json` · MTP spec 4, int8 KV, 128K context, pictures on
### What happened
Related to #210 and #4078, but a different shape: here the **model** gets the markup slightly wrong. When a value contains a nested `<parameter=X>...</parameter>` pair (e.g. editing a file that documents the call format), Flash-Next often skips the value's **own** closing `</parameter>` and goes straight to `</function>` or the next parameter:
```
<tool_call>
<function=edit_file>
<parameter=path>
docs/tools.md
</parameter>
<parameter=new_string>
<parameter=limit>25</parameter>
</function>
</tool_call>
```
`param_end` takes the nested `</parameter>` (followed by `</function>`) as the end of `new_string`, so the call is delivered with `new_string = "<parameter=limit>25"`. No error, the client runs the edit with the truncated value. A following call in the same turn is often lost as well.
Parser-level repro:
```python
from serve.frontend import param_end
for t in ['<parameter=limit>25</parameter>\n</function>\n</tool_call>',
'<parameter=limit>25</parameter>\n<parameter=old_string>x</parameter>\n</function>',
'<parameter=limit>25</parameter>\n</parameter>\n</function>']:
e = param_end(t, final=True, name='new_string'); print(repr(t[:e]))
# '<parameter=limit>25' <- wrong
# '<parameter=limit>25' <- wrong
# '<parameter=limit>25</parameter>\n' <- correct (closer present)
```
End to end: the two-turn agent probe from ExTV/strata-5090-4070 (`tools/tool_probe.py 30`, edits a file that documents the call format) scored 7/30 on `main`; turn 1 passed 30/30, and about 15 of the 23 failures were exactly this truncation.
### Suggested fix
Count nested `<parameter=` openers inside the value: a `</parameter>` that closes a nested opener is value text; the value ends at the first unmatched one. If the closer was skipped (all nested pairs matched), end the value right before `</function>` (+ `</tool_call>`) or before the next *declared* parameter of the named tool that has not been given yet. ExTV/strata-5090-4070 (MIT) carries this against v0.2.1 in `patches/01-dual-gpu-series-on-v0.2.1.patch` (`serve/frontend.py` hunks, test `serve/test_skipped_closer.py`); it needs adapting to the #4078/#4427 changes in current `param_end`.
関連リンク
インストール・モデル・リリースへのサイト内リンク。