mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #3850] [TUI] strata connect writes a 15,000-token compaction point into every app config, whatever the server's context #1640
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#1640
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 @demetree on GitHub (Oct 23, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3850
Area
[TUI] (the Terminal:
strata connect)Desktop app, Terminal or source?
Terminal (the
stratacommand)What happened
strata connect <app> --context 256kgives the app a 256K window and then tells it to compact its conversation at15,000 tokens. Every app the command configures gets the same flat number:
compaction.buffermax(1024, input_limit - 15000)model_auto_compact_token_limit15000compaction.thresholdTokens15000compaction.reserveTokensmax(1024, context - 15000)compression.threshold_tokens15000COMPACT_AT = 15000instrata_cli/launch/harness.pyline 24. Its own comment says where it came from: the configs"were tested for real against a Strata server at 32K context (... plus streaming, thinking and compaction at about
15K)". It is the point a 32K config was tested at, and it is applied at every context size.
At 32K, 15,000 is reasonable: OpenCode's own system prompt and tools take about 7.4K tokens
(
_limits_opencode), so 15,000 + 7.4K + 4,096 output still fits a 32K window - which is what #1648 was about.On a 256K server the same 15,000 is 5.8% of the window. The conversation is summarised roughly every 15,000 tokens,
each time into a hardcoded 4,096-token summary, and the rest of the window is never used. For agentic coding that is
the opposite of what a large context is for.
The apps' own defaults sit near the top of the window, not the bottom: OpenCode documents
bufferas "tokens to keepfree below the model's limit", default 10% of the limit - a ~232K compaction point on a 256K window - with
keep.tokens(default 15,000) controlling how much recent conversation survives beside the summary.What is not scaling is the share. The tests fix the flat value even at a wider window:
tests/terminal/test_launch.py:1204asserts that a 64K--contextproduces"reserveTokens": 50536(65536 ? 15000) - still a 15,000-token point, in a test.
openclawin the same file is the counter-example: itscontextTokensis already scaled to the window (int(t.context * 23192 / 32768)). Only the compaction points wereleft flat.
0.2.3's "the agent chat copes with a full context" is in the app's own chat.
strata_cli/launch/harness.pyisunchanged between 0.2.2 and 0.2.3.1, so every config
strata connectwrites today still carries the flat 15,000.Smallest steps or command that reproduce it
Then read
"compaction"in the printed config:bufferisinput_limit - 15000, so the app compacts at 15,000tokens while
limit.contextsays 262144.Reproduction status
Unconfirmed static analysis (I read code or ran a scanner; I did not see it fail)
I have not watched a live session's compaction request in a server log. The arithmetic above follows the generator
and OpenCode's published description of
buffer/keep.tokens; if you want the observation before choosing a rule,I can run a 256K server with OpenCode and show the point the summary request actually arrives at.
Strata version
Strata 0.2.3.1 ? Control 0.1.48.1 ? engine 0.1.48
Graphics card, memory and system
Intel Arc Pro B70 32 GB ? 64 GB RAM ? Windows 11 25H2 (the generated config was observed here; the code path is
platform-independent)
Model, size and settings
Qwen3.8-Flash-Next Coder IQ1_M ? 256K context ?
--kv-resident 32768A rule that fixes all five at once
Keep the share the tested 32K configs used (15,000 of a 28,672 input limit = 52.3%) and scale it with the input
limit, so the summarising request - which carries the whole conversation - still fits the window:
A patch is ready for review (linked below). A 32K server stays byte-identical to what was tested; a 64K or 256K
server gets different bytes, which is the point. Alternatives: match each app's own default instead of one rule, or
use a larger share (80%, a 206,438-token point on a 256K window).
Related
dsh-compaction-basic's fixed 65,536-token headroom leaves no pressurebudget on a 64K window.
@nabe2030 commented on GitHub (Oct 25, 2026):
A data point from the other side of this: with a hand-written OpenCode v2 (2.0.24) config that only sets
limit.context = 262144andlimit.output = 32768(no compaction override, not written bystrata connect), a 6 h 18 min agent session against Strata 0.2.4.1 let the conversation grow to 230,007 tokens (largest single request 234,941) before OpenCode compacted it, and it came out the other side at 77k to 85k. There was no HTTP 400 (fit_max_tokenswas left at its default). So the flat 15,000-token point is only in whatstrata connectwrites, not in OpenCode's own defaults.@Niko1221 commented on GitHub (Oct 26, 2026):
Fixed in 0.2.5: strata connect keeps the share the tested 32K configs used (about half of the input limit) instead of a flat 15,000 tokens, so a 256K server compacts at about 135,000. Please update and run strata connect again to rewrite the app's config.
--aux-cpus: helper threads on spare CPUs, +10% decode on a layer split (Linux, opt-in) #3555STRATA_SPLIT_RINGbefore sizing the lend regions (a 104k read stops reading 10 GB from the file) #3556--memory-limit-mib) #3557--batch-groups auto#3573--adapt-async 1beside slots) #3576