mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #3694] [Other] The agent's automatic compaction cannot compact a 65536-token window: compaction-basic's fixed 65536-token headroom leaves no pressure budget #1533
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#1533
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 @dai8647 on GitHub (Oct 22, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3694
Area
[Other]
(The behaviour is in the agent runtime's compaction backend, not in the engine;
it is filed here because a local Strata engine on a 64K window is what triggers
it, and the engine is what most readers of this tracker run.)
Desktop app, Terminal or source?
Source (the harness plugin
dsh-compaction-basicas shipped in the 0.2.1-rc.2agent runtime, driving a locally built Strata engine).
What happened
dsh-compaction-basic's defaultheadroomTokensis 65536, a fixednumber, while the threshold it computes is
min(0.8 * contextWindow, contextWindow - reservedCompletionTokens - headroomTokens).On a model whose window is 65536 that leaves no pressure budget at all, so
the automatic compaction skips the target and the conversation runs into the
model's wall instead of being compacted:
The step hook catches that error and continues the turn ("step compaction
failed: ...; continuing the turn"), so from the outside the only symptom is
that the context is never compacted: the reply gets cut at the model's window
and the client reports "output token limit reached".
Measured on a local engine behind an OpenAI-compatible server
(Windows, RX 7800 XT, 65536-token window, 32768 reserved output tokens):
request was ever made, and the reply was cut by the server's own window.
headroomTokens: 4096: the same session compacted at 28,672 tokens -a summary request of 29,948 tokens, the session down to 12,475 tokens, and
the engine's prompt cache at 99% reuse on the following turns.
The headroom is the one knob that decides whether a model with a 64K/128K
window can be compacted at all, and 65536 happens to be exactly the size of the
windows where it stops working.
Smallest steps or command that reproduce it
with
contextWindow: 65536and an output budget of 32768.compaction-basicat its defaults (noheadroomTokens).Reproduction status
Deterministic: with the default headroom the compaction never fires on a
65536-token window, and with
headroomTokens: 4096it fires at 28,672 tokensevery time (measured on four runs, same binary).
Strata version
0.1.44.1 (the engine behind the agent runtime; the defect is in the harness
plugin, version 0.2.1-rc.2)
Graphics card, memory and system
RX 7800 XT 16 GB (gfx1101) · 96 GB RAM · Ryzen 5 5500 (AVX2) · Windows 11
Model, size and settings
Swift-Qwen3.8-Flash-Next IQ3_XXS (Swift-abliterated), pack
packs/swift_mmap,--max-context 65536 --vram-reserve-mib 1280, served through anOpenAI-compatible endpoint on 127.0.0.1
Logs
A suggestion: scale the default headroom with the window instead of fixing it
at 65536 - e.g.
headroomTokens = min(65536, floor(contextWindow / 4))- so a64K window keeps a pressure budget (16K headroom, a 16K threshold) and a 1M
window keeps the current behaviour. The threshold would then be
min(0.8*W, W - reserved - min(65536, W/4)), which stays in a sensible bandfor every window size.
@github-actions[bot] commented on GitHub (Oct 22, 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 (Oct 22, 2026):
Thanks, this follows the format now.
@Niko1221 commented on GitHub (Oct 29, 2026):
Thank you. Fixed for Strata's own agent in 0.2.1: it sets the compaction headroom for each model from the window instead of the plugin's fixed 65,536. The headroom is a quarter of what the window has left after the reply room, and the reply room is half the window (at most 32K), so a 64K window can compact. If you run the plugin yourself, set
headroomTokensthe same way.Release: https://github.com/Niko1221/Strata/releases/tag/v0.2.1