mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #3852] [CLOSED] [TUI] scale the app configs' compaction point with the server's context #4802
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#4802
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?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/3852
Author: @demetree
Created: 10/23/2026
Status: ❌ Closed
Base:
main← Head:fix-compaction-point📝 Commits (1)
076fca8strata connect: scale the app configs' compaction point with the server's context📊 Changes
2 files changed (+34 additions, -9 deletions)
View changed files
📝
strata_cli/launch/harness.py(+21 -8)📝
tests/terminal/test_launch.py(+13 -1)📄 Description
Fixes #3850.
Problem
strata connect <app> --context 256kgives the app a 256K window and tells it to compact its conversation at 15,000tokens.
COMPACT_AT = 15000(strata_cli/launch/harness.py:24) is the point a 32K config was tested at - its owncomment says so - and it is written into every app's config at every context size: OpenCode's
compaction.buffer,Codex's
model_auto_compact_token_limit, omp'sthresholdTokens, pi'sreserveTokens, Hermes'threshold_tokens.At 256K that summarises the conversation every 15,000 tokens - 5.8% of the window - into a hardcoded 4,096-token
summary.
tests/terminal/test_launch.py:1204locks it in at a wider window too: a 64K--contextasserts"reserveTokens": 50536, i.e. still a 15,000-token point.Result
The compaction point follows the window, keeping the share the tested configs used (15,000 of a 28,672 input limit =
52.3%):
The share is what carries over because the summarising request carries the whole conversation: the headroom has to
grow with the point. A 32K server stays byte-identical to what was tested, so one existing expectation changes (the
64K one) and the rest are untouched.
Approach
One helper,
compact_at(t), next toTarget.input_limit, and every field above is computed from it. The twoplain-words
limitslines that quoted "15K" now quote the real number (_limits_pi) or refer to it without a number(
_limits_hermes).openclawis untouched: it has no threshold field and itscontextTokensis already scaled tothe window.
Validation
Passed
python -m pytest tests/terminal/test_launch.py -q- 109 passed, 1 skipped (includes a new test,test_the_compaction_point_scales_with_the_window, which pins 135,000 at 256K and 15,000 at 32K).test_launch_tui,test_tuiqa_launch,test_tuiqa_wizard,test_launch_monitor,test_data_dir_choice,test_discovery,test_flow2_022,test_issues_022,test_launch_engine_first) - 213 passed, 3 skipped.Failed
Not run
tests/terminalas one command. The first attempt collected 8 errors (the monitor files needrequirements-monitor.txt;rich/textualwere not installed), and after installing it the full run exceeded thetime I gave it, so I have no result for it. Nothing in it reads
harness.pyexcept the files above, but that is anargument, not a result.
buffersemantics come from its published documentation ("tokens to keep free below themodel's limit", default 10% of the limit) and the arithmetic in this diff - I did not observe a compaction request in
a server log. The other four apps' fields are set by the same rule; I did not run those apps.
python tools/test_setup_*.py: untouched by this change (Terminal-only, no engine or setup code).Limits
larger share (80%) is the obvious alternative; so is leaving OpenCode's
bufferout entirely so its own defaultapplies.
point of the change, and it is why this was raised as an issue first.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.