mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #3753] [TUI] connect pi: compaction occurs at 15,000 tokens regardless of context window size #1578
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#1578
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 @dnnkeeper on GitHub (Oct 22, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3753
Area
[TUI]
(
strata connectis the Terminal's connect command.)Desktop app, Terminal or source?
Terminal (the
stratacommand)What happened
strata connect piwrites acompaction.reserveTokensthat grows with the served context window. In pi,reserveTokensis headroom it keeps free for the response, not a conversation budget, so a reserve thatscales with the window makes the compaction trigger stay at 15,000 tokens whatever the window is.
On my 128K session pi compacted after about 15,000 tokens of a 131,072-token window, then kept compacting
every turn or two after that. The 116K of the window I had paid for was never used.
pi's own reference says the reserve is fixed headroom and does not scale:
docs/compaction.md of pi 1.1.0, and pi 1.1.0's default in its own settings-manager is 16384 for every model.
Strata writes instead (strata_cli/launch/harness.py,
pi_settings, line 134):Values
strata connect piprints for the same model at each served window (measured on my machine):Expected: at 128K the app should keep most of the window for the conversation and compact when the
window is close to full, the way pi's own default does at every window size.
Actual: it compacts at 15,000 tokens, and nothing on screen says a line at 15,000 was chosen:
the limits text for pi (harness.py:182) says the same "about 15K tokens before it summarises" at 128K as
at 32K, so the config read back to me looked reasonable.
The 32K case is the only one that was ever measured: harness.py's own docstring (line 3) says the eight
configs come from configs "tested for real against a Strata server at 32K context". So this is the
tested 32K constant applied unchanged to windows nobody checked, written in the one app's unit where it
becomes a meaningless number.
The presence of the key is right and should stay: for other apps the app's own default is broken for a
local model (without
limit.inputOpenCode never compacts, and Claude Code withoutCLAUDE_CODE_MAX_CONTEXT_TOKENS"never compacts, or compacts on every turn"). It is the value atnon-32K windows that is wrong.
Smallest steps or command that reproduce it
No GPU and no download needed to see the value written:
To see the behaviour in pi itself:
strata connect pi --write --yes, start a session and watch the first/compact-style summary land near 15,000 tokens of a 131,072-token window rather than near the end.Workaround I used: after
strata connect piwrote the file I setcompaction.reserveTokensby hand backto a fixed headroom and left everything else as written.
Reproduction status
Reproduced locally for the values
strata connectprints and for the early compaction in my 128K session.pi's trigger formula and its 16384 default are read from pi 1.1.0's own docs and settings-manager on my
machine, not re-derived from a Strata run. I did not test a 64K pi session and did not measure any
engine-side cost of the extra compactions.
Strata version
strata 0.2.2 (build 0.1.47) — from
strata --version.pi 1.1.0 (
npm install -g @earendil-works/pi-coding-agenttoday);strata connect pi --checkreportsthis config was tested with pi 0.74.2, so the pi version I read the semantics from is not the one
the config was tested against.
@Niko1221 commented on GitHub (Oct 26, 2026):
Fixed in 0.2.5 (see #3850): the compaction point scales with the window, so a 128K session no longer compacts at 15,000 tokens. Run strata connect pi again after updating.