okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

Niko1221Merge branch 'f-1402-w' into f-140253623e56f

main
7.1 KiB108 linesraw

What 0.1.40.1 does with a <tool_call> the model writes, and with requests waiting for a dead engine

Measured on 2026-10-06 by Dmitry-B, on the machine described in 2026-10-03-community-rtx4090-iq3xxs-200k (RTX 4090, qwen3.8-flash-next-iq3_xxs, context 204800). Results-only report about the two fixes of the hotfix release v0.1.40.1 (82f46a8): the rules for a <tool_call> written by the model (#804, #1058) and requests waiting during an engine restart (#1012). The engine binary is the one built for 0.1.40 and is byte-identical to it (196504f2822cbf15fb49b873e0000f41); only the Python server changed.

What was run

FileWhat it is
probe_parser_corpus.py, corpus_results.jsonthe author's own corpus serve/fixtures/rcall_specimens.json replayed through the same parser the server uses
probe_toolcall.py, results.jsonlive chat requests with a declared tool, to see what the API returns end to end
probe_restart_waiters.py, results_restart.jsonthree requests waiting for the engine, the engine killed while reading a prompt

1. The corpus of quoted and stranded calls, replayed

serve/fixtures/rcall_specimens.json holds 37 specimens: 16 must become tool calls, 21 must stay text. Each was fed to serve.frontend.OutputParser — the class the server itself uses — at six feed widths (1, 2, 3, 7, random 1-9 characters, and the whole text at once) and with stream_tools on and off: the same matrix as serve/test_reasoning_rescue.py, but recorded per specimen instead of pass/fail.

образцов 37, должны дать вызов: 16, должны остаться текстом: 21, провалились: 0

37/37, 444 parser runs, no mismatch, and for every specimen the streamed result equals the whole-text result. Per-specimen detail: corpus_results.json.

2. Live requests with a tool declared

get_weather was declared in tools; each prompt either shows a call as an example (in a code fence or inline code) or asks for a real call. reasoning_effort is stated per case, because the rules are about where the text sits — in the thinking or in the visible answer. totals.tool_calls_from_reasoning was read before and after the whole set.

CaseExpectedReturnedWhere the call text stayedVerdict
1-fenced-example-in-answer (thinking on)no call1 callreasoning_contentnot conclusive — see below
2-inline-code-in-answer (thinking off)no call1 callnowhere (the model emitted a top-level call)not conclusive
3-fenced-example-in-thinking (thinking high)no call0content, reasoning_contentmatches
4-turn-cut-by-max-tokens (max_tokens=60, thinking high)no call0reasoning_contentmatches
5-real-call-top-level-after-sentence (thinking off)call1 call—matches
6-plain-real-callcall1 call—matches
7-streaming-split-fence (stream, fence split across chunks)no call0content, reasoning_contentmatches
8-fenced-example-in-answer-no-thinkingno call0contentmatches

totals.tool_calls_from_reasoning stayed 0 → 0 across the whole set: none of these prompts made the model strand a call in its thinking, so the rescue path never had anything to rescue. The calls in cases 1, 2, 5 and 6 came through the ordinary path.

That is also why cases 1 and 2 are recorded as inconclusive rather than as failures. In case 1 the model put the example inside a fenced block in its reasoning (the text is still there in reasoning_content) and produced a separate top-level call; in case 2, with thinking off, it answered with a top-level call instead of copying the inline code. Both are model behaviour, not the rule being broken — the rule was applied to what the model actually wrote, and the counter shows no rescue was performed. Raw text of every answer: results.json.

What is shown end to end: a <tool_call> inside a code fence in the visible answer stays text, including when the answer streams and the fence is split across chunks (cases 7, 8), a call written in the thinking of a turn cut by max_tokens stays text (case 4), and ordinary calls keep working (cases 5, 6).

3. Requests waiting for an engine that dies (#1012)

Three requests with ~60 000-token prompts were started together; 15 s later pkill killed the engine process (two pids, 39647 and 39659).

RequestHTTPFirst streamed deltaRequest endedDeltas
waiter-1200none16.6 s after start0
waiter-220040.4 s40.5 s after start3
waiter-320040.3 s40.4 s after start3

The server started a new engine 25.5 s after the kill and /health reported loaded: true at the same point. Two waiters continued with the new engine and finished at ~40 s; the one whose stream had already been opened was closed at 16.6 s with no content. Nothing hung: no request waited 300 s, and no list.remove(x): x not in list appeared. For comparison, this is the case that on 0.1.40 ended about 300 s later with 1 and 5 tokens — see 2026-10-06-community-rtx4090-opt-ins.

Server-side detail, including the engine command line it restarted with: results_restart.json.

Unit tests on this machine, for the same commit

tools.test_setup_golden tools.test_setup_amd tools.test_setup_choices tools.test_setup_config
tools.test_setup_hotfix_tag                                                     -> 87 tests, OK
serve.test_responses serve.test_security serve.test_server serve.test_slots serve.test_runconfig
serve.test_mcp serve.test_monitor serve.test_frontend serve.test_structured serve.test_detok
serve.test_reasoning_tools serve.test_reasoning_loop_recovery serve.test_reasoning_rescue
serve.test_restart_waiters serve.test_parallel serve.test_vram                  -> 430 tests, OK (skipped=5)
serve.test_control_cancel serve.test_fatal_recovery                             -> 10 tests, OK

527 tests, 0 failures. On 0.1.40 the same set was 492; the difference is the two new modules of this release.

Limitations

  • The corpus replay exercises the parser, not the HTTP layer. The end-to-end part (section 2) did not produce a real stranded call on this model, so the rescue path was not observed through the API — only the "must stay text" half of the rules was.
  • The three waiters sent identical filler text, so the engine reused the prefix cache (the log shows prompt 141045 tokens = 140329 reused + 716 read). That is fine for a hang test and wrong for a speed test; no throughput conclusion is drawn from it.
  • waiter-1 ended with HTTP 200 and no content rather than the 503 the release notes describe: its stream had already been opened, so the server could not answer 503 any more. Reported as measured.
  • One machine, one model, one engine restart. Cancellation mid-turn and the batch-window ERR reporting were not tested.
1# What 0.1.40.1 does with a `<tool_call>` the model writes, and with requests waiting for a dead engine
2
3Measured on 2026-10-06 by [Dmitry-B](https://github.com/Dmitry-B), on the machine described in
4[2026-10-03-community-rtx4090-iq3xxs-200k](../2026-10-03-community-rtx4090-iq3xxs-200k/README.md)
5(RTX 4090, `qwen3.8-flash-next-iq3_xxs`, context 204800). Results-only report about the two fixes of the hotfix
6release v0.1.40.1 (`82f46a8`): the rules for a `<tool_call>` written by the model (#804, #1058) and requests waiting
7during an engine restart (#1012). The engine binary is the one built for 0.1.40 and is byte-identical to it
8(`196504f2822cbf15fb49b873e0000f41`); only the Python server changed.
9
10## What was run
11
12| File | What it is |
13| --- | --- |
14| `probe_parser_corpus.py`, `corpus_results.json` | the author's own corpus `serve/fixtures/rcall_specimens.json` replayed through the same parser the server uses |
15| `probe_toolcall.py`, `results.json` | live chat requests with a declared tool, to see what the API returns end to end |
16| `probe_restart_waiters.py`, `results_restart.json` | three requests waiting for the engine, the engine killed while reading a prompt |
17
18## 1. The corpus of quoted and stranded calls, replayed
19
20`serve/fixtures/rcall_specimens.json` holds 37 specimens: 16 must become tool calls, 21 must stay text. Each was
21fed to `serve.frontend.OutputParser` — the class the server itself uses — at six feed widths (1, 2, 3, 7, random
221-9 characters, and the whole text at once) and with `stream_tools` on and off: the same matrix as
23`serve/test_reasoning_rescue.py`, but recorded per specimen instead of pass/fail.
24
25```
26образцов 37, должны дать вызов: 16, должны остаться текстом: 21, провалились: 0
27```
28
2937/37, 444 parser runs, no mismatch, and for every specimen the streamed result equals the whole-text result.
30Per-specimen detail: [corpus_results.json](corpus_results.json).
31
32## 2. Live requests with a tool declared
33
34`get_weather` was declared in `tools`; each prompt either shows a call as an example (in a code fence or inline
35code) or asks for a real call. `reasoning_effort` is stated per case, because the rules are about where the text
36sits — in the thinking or in the visible answer. `totals.tool_calls_from_reasoning` was read before and after the
37whole set.
38
39| Case | Expected | Returned | Where the call text stayed | Verdict |
40| --- | --- | --- | --- | --- |
41| `1-fenced-example-in-answer` (thinking on) | no call | 1 call | `reasoning_content` | not conclusive — see below |
42| `2-inline-code-in-answer` (thinking off) | no call | 1 call | nowhere (the model emitted a top-level call) | not conclusive |
43| `3-fenced-example-in-thinking` (thinking high) | no call | 0 | `content`, `reasoning_content` | matches |
44| `4-turn-cut-by-max-tokens` (`max_tokens=60`, thinking high) | no call | 0 | `reasoning_content` | matches |
45| `5-real-call-top-level-after-sentence` (thinking off) | call | 1 call | — | matches |
46| `6-plain-real-call` | call | 1 call | — | matches |
47| `7-streaming-split-fence` (stream, fence split across chunks) | no call | 0 | `content`, `reasoning_content` | matches |
48| `8-fenced-example-in-answer-no-thinking` | no call | 0 | `content` | matches |
49
50`totals.tool_calls_from_reasoning` stayed **0 → 0** across the whole set: none of these prompts made the model
51strand a call in its thinking, so the rescue path never had anything to rescue. The calls in cases 1, 2, 5 and 6
52came through the ordinary path.
53
54That is also why cases 1 and 2 are recorded as inconclusive rather than as failures. In case 1 the model put the
55example inside a fenced block in its reasoning (the text is still there in `reasoning_content`) and produced a
56separate top-level call; in case 2, with thinking off, it answered with a top-level call instead of copying the
57inline code. Both are model behaviour, not the rule being broken — the rule was applied to what the model actually
58wrote, and the counter shows no rescue was performed. Raw text of every answer: [results.json](results.json).
59
60What is shown end to end: a `<tool_call>` inside a code fence in the visible answer stays text, including when the
61answer streams and the fence is split across chunks (cases 7, 8), a call written in the thinking of a turn cut by
62`max_tokens` stays text (case 4), and ordinary calls keep working (cases 5, 6).
63
64## 3. Requests waiting for an engine that dies (#1012)
65
66Three requests with ~60 000-token prompts were started together; 15 s later `pkill` killed the engine process
67(two pids, `39647` and `39659`).
68
69| Request | HTTP | First streamed delta | Request ended | Deltas |
70| --- | --- | --- | --- | --- |
71| `waiter-1` | 200 | none | 16.6 s after start | 0 |
72| `waiter-2` | 200 | 40.4 s | 40.5 s after start | 3 |
73| `waiter-3` | 200 | 40.3 s | 40.4 s after start | 3 |
74
75The server started a new engine 25.5 s after the kill and `/health` reported `loaded: true` at the same point.
76Two waiters continued with the new engine and finished at ~40 s; the one whose stream had already been opened was
77closed at 16.6 s with no content. Nothing hung: no request waited 300 s, and no `list.remove(x): x not in list`
78appeared. For comparison, this is the case that on 0.1.40 ended about 300 s later with 1 and 5 tokens — see
79[2026-10-06-community-rtx4090-opt-ins](../2026-10-06-community-rtx4090-opt-ins/README.md).
80
81Server-side detail, including the engine command line it restarted with: [results_restart.json](results_restart.json).
82
83## Unit tests on this machine, for the same commit
84
85```
86tools.test_setup_golden tools.test_setup_amd tools.test_setup_choices tools.test_setup_config
87tools.test_setup_hotfix_tag                                                     -> 87 tests, OK
88serve.test_responses serve.test_security serve.test_server serve.test_slots serve.test_runconfig
89serve.test_mcp serve.test_monitor serve.test_frontend serve.test_structured serve.test_detok
90serve.test_reasoning_tools serve.test_reasoning_loop_recovery serve.test_reasoning_rescue
91serve.test_restart_waiters serve.test_parallel serve.test_vram                  -> 430 tests, OK (skipped=5)
92serve.test_control_cancel serve.test_fatal_recovery                             -> 10 tests, OK
93```
94
95527 tests, 0 failures. On 0.1.40 the same set was 492; the difference is the two new modules of this release.
96
97## Limitations
98
99- The corpus replay exercises the parser, not the HTTP layer. The end-to-end part (section 2) did not produce a
100  real stranded call on this model, so the rescue path was not observed through the API — only the "must stay text"
101  half of the rules was.
102- The three waiters sent identical filler text, so the engine reused the prefix cache (the log shows
103  `prompt 141045 tokens = 140329 reused + 716 read`). That is fine for a hang test and wrong for a speed test;
104  no throughput conclusion is drawn from it.
105- `waiter-1` ended with HTTP 200 and no content rather than the 503 the release notes describe: its stream had
106  already been opened, so the server could not answer 503 any more. Reported as measured.
107- One machine, one model, one engine restart. Cancellation mid-turn and the batch-window `ERR` reporting were not
108  tested.