Files
Strata/app/host/server
Niko1221 991fe4fc5b agent: leave a compaction range alone when a summary cannot bring the conversation under the limit
The Harness starts pressure compaction at a token count that depends on the window (profile.mjs compactionThreshold). A chat's fixed part (system
prompt and tools) is about 10.5K tokens (context-fit.mjs BASE_TOKENS). On a 16K window the threshold is 10,036, below that fixed part, so every step
started a compaction: a summary request over the conversation and a rewritten history that the engine reads again from the start (measured on an RTX
3060, SQ-20, one slot: cached_tokens 0 on every step, 31-36 s of prompt reading per step, plus 8-24 s per summary).

profile.mjs now also hands the plugin the limit of each route and model; strata-compaction.mjs skips a pressure compaction when the tokens outside the
range plus a minimal summary already reach that limit. The context-overflow trigger, ranges that do bring the conversation under the limit, models
without a limit, and an unmeasured total behave as before.
2026-12-02 00:07:01 +01:00
..