[GH-ISSUE #3928] [Engine] Stop during a long prompt read loses the read prefix; the next message re-reads 375K tokens (22 min) #1680

Open
opened 2026-11-04 01:53:08 +07:00 by bsakaguchi · 4 comments
Owner

Originally created by @xvcezrqpbxtpzblrt on GitHub (Oct 24, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3928

Area

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

Desktop app, Terminal or source?

Desktop app (Windows, Linux or Mac)

What happened

A long agent chat on Strata 0.2.3 / engine 0.1.48 (Swift 1.5 IQ3_XXS, 512K context, --kv int8) reached 420,729 tokens. The auto-compaction threshold for this window is 419,430 tokens (see Root cause). The next prompt was 375,788 tokens — 44,941 tokens shorter — and only 6,165 tokens matched the cached prefix.

While the engine was reading that prompt, I pressed Stop at 506 s / 148,480 of 369,623 tokens. The next message was 375,844 tokens, and the engine reported:

prompt 375844 tokens = 0 reused + 375844 read in 1317159 ms (285.3 tok/s), 327 generated in 12553 ms

The chat showed "thinking" for 21 m 57 s before the first token. The answer itself took 12.5 s. It was not a hang: reading the prompt advanced by 1,024 tokens about every 3.5 s (... 375,791 of 375,844 tokens, 1317 s so far).

The same cold read happens without Stop when a subagent request takes the engine slot. A 12,465-token child request was served (6,127 reused + 6,338 read), then the parent's next turn was 385,386 tokens and re-read 379,259 tokens in 1,326,029 ms (22 m 06 s), with only 6,127 reused. The parent's 6,406 MiB snapshot was refused by the 3,840 MiB conversation cache.

So the user-visible symptom is "after I stop it, the next message thinks for 20+ minutes". The engine is not stuck; it is re-reading the whole prompt from token 0.

Smallest steps or command that reproduce it

  1. Use a local model with a 512K window (--max-context 524288, --kv int8), e.g. Swift 1.5 IQ3_XXS.
  2. Let an agent chat grow past the auto-compaction threshold (419,430 tokens; 420,729 in this log).
  3. Send the next message. The prompt drops to 375,788 tokens; only 6,165 tokens are reused.
  4. While the engine is reading the prompt, press Stop. In this log it stopped at 506 s, after 148,480 of 369,623 tokens.
  5. Send another message. The engine reports 0 reused + 375844 read in 1317159 ms; the UI shows "thinking" for about 22 minutes.

Without Stop: run a subagent request in the same long chat, then continue the parent. The parent's next turn re-reads 379,259 tokens (22 m 06 s).

Reproduction status

Reproduced locally

Strata version

Strata 0.2.3, engine 0.1.48, Windows 11 Pro 26H2 build 26300. Code references are to the public repository main@8183c6b (2026-10-24); the installed engine 0.1.48 was built earlier, so line numbers may shift, but the log strings match.

Graphics card, memory and system

NVIDIA GeForce RTX 3080 Ti Laptop GPU, 16 GB VRAM · 64 GB RAM · Windows 11 Pro 26H2, build 26300.

Model, size and settings

Swift 1.5 IQ3_XXS · 512K context (--max-context 524288) · --kv int8 · --vram-reserve-mib 1536 · conversation cache auto-sized to 3,840 MiB for up to 4 parked conversations.

Logs

strata serve: prompt 420729 tokens = 415949 reused + 4780 read in 17141 ms (278.9 tok/s), 242 generated in 6669 ms (36.3 tok/s), 6 checkpoints
strata serve: conversation cache: skip parking (snapshot 6925 MiB exceeds available budget)
strata serve: prompt 375788 tokens = 6165 reused + 148480 of 369623 read in 506097 ms (293.4 tok/s), 0 generated in 0 ms (0.0 tok/s), drafts accepted 0 of 0, 6 checkpoints (cancelled)
[strata] done: 0 tokens in 506 s (no speed) (cancel, cancel=True)
strata serve: prompt 375844 tokens = 0 reused + 375844 read in 1317159 ms (285.3 tok/s), 327 generated in 12553 ms (26.0 tok/s), 6 checkpoints
[strata] reading the prompt: 375,791 of 375,844 tokens, 1317 s so far
[strata] thinking: 7 of budget 24576 (max 32768) tokens, 21.8 tok/s, 1318 s
strata serve: conversation cache sized from the free RAM: 3840 MiB for up to 4 parked conversations, so an agent's next turn reuses its prompt
strata serve: conversation cache: skip parking (snapshot 6406 MiB exceeds available budget)
strata serve: prompt 12465 tokens = 6127 reused + 6338 read in 21595 ms (293.5 tok/s), 1939 generated in 51360 ms (37.8 tok/s), 2 checkpoints
strata serve: prompt 385386 tokens = 6127 reused + 379259 read in 1326029 ms (286.0 tok/s), 447 generated in 13607 ms (32.8 tok/s), 6 checkpoints

Root cause and suggested fix

1. Auto-compaction rewrites the early history, so the old prefix no longer matches.

localOutputBudget(524288) is 32,768 and compactionHeadroom(524288, 32768) is 61,440, so the host's threshold is:

min(0.8 × 524,288, 524,288 − 32,768 − 61,440) = 419,430

The request at 420,729 crossed it. The next prompt is 375,788, 44,941 tokens shorter; the summary replaced the early messages. Only the system-prompt prefix (6,165 tokens) still matches. This is the same post-compaction re-read pattern as #3701 (there: 154,601 tokens re-read on 2× V100; here: 369,623 tokens on a 16 GB laptop).

2. A Stop during the read does not keep the read prefix, and the next request clears the checkpoints.

The read loop sets pp_exact = false before a batched/pipelined part (src/program/generate.cpp L14084) and sets it true only after the part completes. The #1620 retention branch requires pp_exact (generate.cpp L15232–L15248), so a cancel that lands inside a part does not keep the session. The log contains no cancelled request keeps its conversation line (0 occurrences).

The next request then starts at resume == 0; generate.cpp L12951–L12959 calls checks.clear(), dropping the 6 checkpoints the cancelled read had banked. That is why the next request reports 0 reused, not 6,165. The checkpoints are described as "still good" in the cancel path comment (L15233–L15234), but they are discarded on the next request.

This is different from #1620 (closed; its fix only applies to a cancel between two windows, where pp_exact is true) and from #3675 (open; there the cancel does not stop the read at all). Here the read does stop, but its progress is thrown away.

3. The parking fallback cannot save the conversation because the snapshot is larger than the cache.

The 375K-token conversation snapshot is 6,925 MiB; the auto-sized cache is 3,840 MiB for up to 4 parked conversations. make_room() returns false and generate.cpp L9560–L9563 prints skip parking and continues with a full read. This is not an edge case on a 64 GB machine with a 512K window: a 375K-token chat needs about 6.9 GB of KV, nearly twice the default budget.

4. A subagent request causes the same cold read without Stop.

The 12,465-token child request takes the engine slot. The parent's 6,406 MiB snapshot cannot be parked, so the parent's next turn re-reads 379,259 tokens (22 m 06 s). This is the normal coding-assistant workflow, not an unusual action.

5. The UI calls all of this "thinking".

The host polls /metrics and treats the advancing prompt_read as activity, so the watchdog gives the engine up to 30 minutes (engineGraceMs). The turn is not killed, but the chat only shows "thinking" with no prefill progress or ETA. The engine knows the numbers; the UI does not show them.

Suggested fix, in order of impact:

  1. On a mid-read cancel, keep the last complete checkpoint/prefix instead of dropping it. Do not clear checks on the next resume == 0 when the new prompt shares a prefix; try the nearest checkpoint and re-read only the tail.
  2. Size the conversation cache to the configured context, spill it to host RAM/disk, or at least warn when the snapshot exceeds the budget. A 6.9 GB snapshot against a 3.84 GB budget should not silently degrade to a full read.
  3. After compaction, preserve a compatible prefix or rebuild the cache from the summary, so the first post-compaction turn does not re-read the whole retained tail. #3701 describes the same cost.
  4. Isolate subagent requests in their own slot so they do not evict the parent's live session.
  5. Show "reading the prompt x/y, about N minutes left" in the chat instead of "thinking", and warn before auto-compaction that the next turn will re-read the prompt.

Searched open and closed issues and PRs for conversation cache, prefill cancel, reading the prompt, compact cache, conversation-cache-mib, keeps its conversation, skip parking, cold prefill, cancel prompt read, stop re-read, compaction re-read, mid-read, and cancelled request.

Closest reports:

  • #3701 (open) — post-compaction re-read: 154,601 tokens / 97.8 s on 2× V100, 420K-token agent session. This report adds the Stop path, the 6.9 GB > 3.84 GB cache refusal, and the 22-minute measurement on 0.2.3 / 0.1.48.
  • #3675 (open) — a client cancel during a single-stage prompt read does not stop the read. Here the read does stop, but the next request clears the checkpoints and re-reads from 0.
  • #1620 (closed) — a cancelled request loses the conversation cache entry it restored; its fix only covers cancels between windows (pp_exact true), not a cancel inside a read part.
  • #2923, #2255 (closed) — parking refused under RAM pressure or pinned slots; this is a plain size mismatch (6.9 GB snapshot vs 3.84 GB budget).
  • #3891 (open) — RFE for a disk-backed conversation cache for subagent workloads; this report is the bug that motivates it.
  • #3623 (open) — the watchdog ended a turn after 4 minutes while the engine read a long prompt; here the 22-minute read itself is the problem, not the watchdog.

No existing report covers the mid-read cancel + checkpoint loss + oversized snapshot combination on 0.2.3 / 0.1.48.

Originally created by @xvcezrqpbxtpzblrt on GitHub (Oct 24, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/3928 ### Area [Engine] (speed, kernels, models, the server and API) ### Desktop app, Terminal or source? Desktop app (Windows, Linux or Mac) ### What happened A long agent chat on Strata 0.2.3 / engine 0.1.48 (Swift 1.5 IQ3_XXS, 512K context, `--kv int8`) reached 420,729 tokens. The auto-compaction threshold for this window is 419,430 tokens (see Root cause). The next prompt was 375,788 tokens — 44,941 tokens shorter — and only 6,165 tokens matched the cached prefix. While the engine was reading that prompt, I pressed Stop at 506 s / 148,480 of 369,623 tokens. The next message was 375,844 tokens, and the engine reported: ```text prompt 375844 tokens = 0 reused + 375844 read in 1317159 ms (285.3 tok/s), 327 generated in 12553 ms ``` The chat showed "thinking" for **21 m 57 s** before the first token. The answer itself took 12.5 s. It was not a hang: `reading the prompt` advanced by 1,024 tokens about every 3.5 s (`... 375,791 of 375,844 tokens, 1317 s so far`). The same cold read happens **without Stop** when a subagent request takes the engine slot. A 12,465-token child request was served (`6,127 reused + 6,338 read`), then the parent's next turn was 385,386 tokens and re-read 379,259 tokens in 1,326,029 ms (22 m 06 s), with only 6,127 reused. The parent's 6,406 MiB snapshot was refused by the 3,840 MiB conversation cache. So the user-visible symptom is "after I stop it, the next message thinks for 20+ minutes". The engine is not stuck; it is re-reading the whole prompt from token 0. ### Smallest steps or command that reproduce it 1. Use a local model with a 512K window (`--max-context 524288`, `--kv int8`), e.g. Swift 1.5 IQ3_XXS. 2. Let an agent chat grow past the auto-compaction threshold (419,430 tokens; 420,729 in this log). 3. Send the next message. The prompt drops to 375,788 tokens; only 6,165 tokens are reused. 4. While the engine is reading the prompt, press Stop. In this log it stopped at 506 s, after 148,480 of 369,623 tokens. 5. Send another message. The engine reports `0 reused + 375844 read in 1317159 ms`; the UI shows "thinking" for about 22 minutes. Without Stop: run a subagent request in the same long chat, then continue the parent. The parent's next turn re-reads 379,259 tokens (22 m 06 s). ### Reproduction status Reproduced locally ### Strata version Strata 0.2.3, engine 0.1.48, Windows 11 Pro 26H2 build 26300. Code references are to the public repository `main@8183c6b` (2026-10-24); the installed engine 0.1.48 was built earlier, so line numbers may shift, but the log strings match. ### Graphics card, memory and system NVIDIA GeForce RTX 3080 Ti Laptop GPU, 16 GB VRAM · 64 GB RAM · Windows 11 Pro 26H2, build 26300. ### Model, size and settings Swift 1.5 IQ3_XXS · 512K context (`--max-context 524288`) · `--kv int8` · `--vram-reserve-mib 1536` · conversation cache auto-sized to 3,840 MiB for up to 4 parked conversations. ### Logs ```text strata serve: prompt 420729 tokens = 415949 reused + 4780 read in 17141 ms (278.9 tok/s), 242 generated in 6669 ms (36.3 tok/s), 6 checkpoints strata serve: conversation cache: skip parking (snapshot 6925 MiB exceeds available budget) strata serve: prompt 375788 tokens = 6165 reused + 148480 of 369623 read in 506097 ms (293.4 tok/s), 0 generated in 0 ms (0.0 tok/s), drafts accepted 0 of 0, 6 checkpoints (cancelled) [strata] done: 0 tokens in 506 s (no speed) (cancel, cancel=True) strata serve: prompt 375844 tokens = 0 reused + 375844 read in 1317159 ms (285.3 tok/s), 327 generated in 12553 ms (26.0 tok/s), 6 checkpoints [strata] reading the prompt: 375,791 of 375,844 tokens, 1317 s so far [strata] thinking: 7 of budget 24576 (max 32768) tokens, 21.8 tok/s, 1318 s ``` ```text strata serve: conversation cache sized from the free RAM: 3840 MiB for up to 4 parked conversations, so an agent's next turn reuses its prompt strata serve: conversation cache: skip parking (snapshot 6406 MiB exceeds available budget) strata serve: prompt 12465 tokens = 6127 reused + 6338 read in 21595 ms (293.5 tok/s), 1939 generated in 51360 ms (37.8 tok/s), 2 checkpoints strata serve: prompt 385386 tokens = 6127 reused + 379259 read in 1326029 ms (286.0 tok/s), 447 generated in 13607 ms (32.8 tok/s), 6 checkpoints ``` ### Root cause and suggested fix **1. Auto-compaction rewrites the early history, so the old prefix no longer matches.** `localOutputBudget(524288)` is 32,768 and `compactionHeadroom(524288, 32768)` is 61,440, so the host's threshold is: ```text min(0.8 × 524,288, 524,288 − 32,768 − 61,440) = 419,430 ``` The request at 420,729 crossed it. The next prompt is 375,788, 44,941 tokens shorter; the summary replaced the early messages. Only the system-prompt prefix (6,165 tokens) still matches. This is the same post-compaction re-read pattern as #3701 (there: 154,601 tokens re-read on 2× V100; here: 369,623 tokens on a 16 GB laptop). **2. A Stop during the read does not keep the read prefix, and the next request clears the checkpoints.** The read loop sets `pp_exact = false` before a batched/pipelined part (`src/program/generate.cpp` L14084) and sets it true only after the part completes. The #1620 retention branch requires `pp_exact` (`generate.cpp` L15232–L15248), so a cancel that lands inside a part does not keep the session. The log contains **no** `cancelled request keeps its conversation` line (0 occurrences). The next request then starts at `resume == 0`; `generate.cpp` L12951–L12959 calls `checks.clear()`, dropping the 6 checkpoints the cancelled read had banked. That is why the next request reports `0 reused`, not 6,165. The checkpoints are described as "still good" in the cancel path comment (L15233–L15234), but they are discarded on the next request. This is different from #1620 (closed; its fix only applies to a cancel between two windows, where `pp_exact` is true) and from #3675 (open; there the cancel does not stop the read at all). Here the read does stop, but its progress is thrown away. **3. The parking fallback cannot save the conversation because the snapshot is larger than the cache.** The 375K-token conversation snapshot is 6,925 MiB; the auto-sized cache is 3,840 MiB for up to 4 parked conversations. `make_room()` returns false and `generate.cpp` L9560–L9563 prints `skip parking` and continues with a full read. This is not an edge case on a 64 GB machine with a 512K window: a 375K-token chat needs about 6.9 GB of KV, nearly twice the default budget. **4. A subagent request causes the same cold read without Stop.** The 12,465-token child request takes the engine slot. The parent's 6,406 MiB snapshot cannot be parked, so the parent's next turn re-reads 379,259 tokens (22 m 06 s). This is the normal coding-assistant workflow, not an unusual action. **5. The UI calls all of this "thinking".** The host polls `/metrics` and treats the advancing `prompt_read` as activity, so the watchdog gives the engine up to 30 minutes (`engineGraceMs`). The turn is not killed, but the chat only shows "thinking" with no prefill progress or ETA. The engine knows the numbers; the UI does not show them. Suggested fix, in order of impact: 1. On a mid-read cancel, keep the last complete checkpoint/prefix instead of dropping it. Do not clear `checks` on the next `resume == 0` when the new prompt shares a prefix; try the nearest checkpoint and re-read only the tail. 2. Size the conversation cache to the configured context, spill it to host RAM/disk, or at least warn when the snapshot exceeds the budget. A 6.9 GB snapshot against a 3.84 GB budget should not silently degrade to a full read. 3. After compaction, preserve a compatible prefix or rebuild the cache from the summary, so the first post-compaction turn does not re-read the whole retained tail. #3701 describes the same cost. 4. Isolate subagent requests in their own slot so they do not evict the parent's live session. 5. Show "reading the prompt x/y, about N minutes left" in the chat instead of "thinking", and warn before auto-compaction that the next turn will re-read the prompt. ### Duplicate search Searched open and closed issues and PRs for `conversation cache`, `prefill cancel`, `reading the prompt`, `compact cache`, `conversation-cache-mib`, `keeps its conversation`, `skip parking`, `cold prefill`, `cancel prompt read`, `stop re-read`, `compaction re-read`, `mid-read`, and `cancelled request`. Closest reports: - **#3701 (open)** — post-compaction re-read: 154,601 tokens / 97.8 s on 2× V100, 420K-token agent session. This report adds the Stop path, the 6.9 GB > 3.84 GB cache refusal, and the 22-minute measurement on 0.2.3 / 0.1.48. - **#3675 (open)** — a client cancel during a single-stage prompt read does not stop the read. Here the read does stop, but the next request clears the checkpoints and re-reads from 0. - **#1620 (closed)** — a cancelled request loses the conversation cache entry it restored; its fix only covers cancels between windows (`pp_exact` true), not a cancel inside a read part. - **#2923, #2255 (closed)** — parking refused under RAM pressure or pinned slots; this is a plain size mismatch (6.9 GB snapshot vs 3.84 GB budget). - **#3891 (open)** — RFE for a disk-backed conversation cache for subagent workloads; this report is the bug that motivates it. - **#3623 (open)** — the watchdog ended a turn after 4 minutes while the engine read a long prompt; here the 22-minute read itself is the problem, not the watchdog. No existing report covers the mid-read cancel + checkpoint loss + oversized snapshot combination on 0.2.3 / 0.1.48.
Author
Owner

@github-actions[bot] commented on GitHub (Oct 24, 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:6380979694 --> @github-actions[bot] commented on GitHub (Oct 24, 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 24, 2026):

Thanks, this follows the format now.

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

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

Checked again on the current engine, 0.1.54 (31 Oct 2026). A stop inside a prompt read still throws away the progress that read had already made — same shape as this report, at a much smaller size. From this machine's strata serve log (%LOCALAPPDATA%\Strata\install\strata-iq3_s.log; engine started 2026-10-30 22:25:21 from components\engine\0.1.54-windows-x86_64-cuda-cuda13, --max-context 393216 --kv int8 --spec 4 --rope-scaling yarn --rope-scale 1.5; 297 prompt-read lines):

strata serve: cancelled request keeps its conversation: 12323 tokens live
strata serve: prompt 12328 tokens = 6162 reused + 6161 of 6166 read in 10078 ms (611.3 tok/s), 0 generated in 0 ms, drafts accepted 0 of 0, 2 checkpoints (cancelled)
strata serve: prompt 12328 tokens = 6162 reused + 6166 read in 9943 ms (620.1 tok/s), 641 generated in 15370 ms (41.7 tok/s), 2 checkpoints

What the three lines say:

  1. A cancelled request does keep the conversation that was already settled — both attempts reuse the same 6,162 tokens, and the line above spells it out. The parked-snapshot side is not the problem in this case.
  2. The read that was in progress is discarded. The cancelled attempt had read 6,161 of the 6,166 tokens it still needed — 99.9% of that segment — and the very next request, with an identical prompt (12328 tokens = 6162 reused), read all 6,166 again, 9,943 ms a second time. The work of a read that got almost to the end is not turned into a checkpoint that the next request could pick up.
  3. Cost here: about 10 seconds per occurrence. This is the mechanism this issue describes, observed on the engine that ships today, which is why I am noting it rather than leaving the report at 0.1.48.

Limits on this data point, stated so it is not over-read:

  • My case is 12,328 tokens, not 375K. I did not reproduce the total-loss case here: in the original, the next request reused 0 tokens and re-read all 375,844 (1,317,159 ms ≈ 22 min), while in mine reuse stayed at 6,162. So 0.1.54 is not behaving exactly like 0.1.48 at this smaller size, and the original's larger context (the 6,406 MiB snapshot refused by a 3.84 GiB budget) is not present in my session.
  • Inferring the 0.1.54 cost at the original size would be a guess, so I am not doing it: what is measured is that a cancelled read's own progress is not kept.
  • This log has zero compaction lines (compact and summar both 0 matches over 297 prompt-read lines): compaction never fired here, because the threshold for a 393,216 window sits above every prompt this run reached (largest 265,093). It therefore says nothing about #3998's five-cycle pattern and should not be read as evidence for or against that issue.

The suggested fix stands unchanged: when a read part is cancelled mid-way, keep the checkpoints made up to that point and resume from the nearest one instead of reading the same segment again.

<!-- gh-comment-id:6539973521 --> @xvcezrqpbxtpzblrt commented on GitHub (Oct 31, 2026): Checked again on the current engine, 0.1.54 (31 Oct 2026). A stop inside a prompt read still throws away the progress that read had already made — same shape as this report, at a much smaller size. From this machine's `strata serve` log (`%LOCALAPPDATA%\Strata\install\strata-iq3_s.log`; engine started 2026-10-30 22:25:21 from `components\engine\0.1.54-windows-x86_64-cuda-cuda13`, `--max-context 393216 --kv int8 --spec 4 --rope-scaling yarn --rope-scale 1.5`; 297 prompt-read lines): ```text strata serve: cancelled request keeps its conversation: 12323 tokens live strata serve: prompt 12328 tokens = 6162 reused + 6161 of 6166 read in 10078 ms (611.3 tok/s), 0 generated in 0 ms, drafts accepted 0 of 0, 2 checkpoints (cancelled) strata serve: prompt 12328 tokens = 6162 reused + 6166 read in 9943 ms (620.1 tok/s), 641 generated in 15370 ms (41.7 tok/s), 2 checkpoints ``` What the three lines say: 1. **A cancelled request does keep the conversation that was already settled** — both attempts reuse the same 6,162 tokens, and the line above spells it out. The parked-snapshot side is not the problem in this case. 2. **The read that was in progress is discarded.** The cancelled attempt had read **6,161 of the 6,166 tokens it still needed** — 99.9% of that segment — and the very next request, with an identical prompt (`12328 tokens = 6162 reused`), read all **6,166 again**, 9,943 ms a second time. The work of a read that got almost to the end is not turned into a checkpoint that the next request could pick up. 3. Cost here: about 10 seconds per occurrence. This is the mechanism this issue describes, observed on the engine that ships today, which is why I am noting it rather than leaving the report at 0.1.48. Limits on this data point, stated so it is not over-read: - My case is 12,328 tokens, not 375K. I did **not** reproduce the total-loss case here: in the original, the next request reused **0** tokens and re-read all 375,844 (1,317,159 ms ≈ 22 min), while in mine reuse stayed at 6,162. So 0.1.54 is not behaving exactly like 0.1.48 at this smaller size, and the original's larger context (the 6,406 MiB snapshot refused by a 3.84 GiB budget) is not present in my session. - Inferring the 0.1.54 cost at the original size would be a guess, so I am not doing it: what is measured is that a cancelled read's own progress is not kept. - This log has **zero** compaction lines (`compact` and `summar` both 0 matches over 297 prompt-read lines): compaction never fired here, because the threshold for a 393,216 window sits above every prompt this run reached (largest 265,093). It therefore says nothing about #3998's five-cycle pattern and should not be read as evidence for or against that issue. The suggested fix stands unchanged: when a read part is cancelled mid-way, keep the checkpoints made up to that point and resume from the nearest one instead of reading the same segment again.
Author
Owner

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

On the current engine we tested a smaller case: a Stop in the middle of a 36K-token read, then the same request again. The second request reused 21,725 of 36,437 tokens, so the checkpoints already saved are kept and only the part after the last one is read again. That is better than the 0.1.48 behaviour you saw (nothing reused). We have not tested your 375K case, where the conversation does not fit the cache and cannot be parked. We have not changed anything for this yet.

<!-- gh-comment-id:6547913426 --> @Niko1221 commented on GitHub (Oct 31, 2026): On the current engine we tested a smaller case: a Stop in the middle of a 36K-token read, then the same request again. The second request reused 21,725 of 36,437 tokens, so the checkpoints already saved are kept and only the part after the last one is read again. That is better than the 0.1.48 behaviour you saw (nothing reused). We have not tested your 375K case, where the conversation does not fit the cache and cannot be parked. We have not changed anything for this yet.
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#1680
No description provided.