Summary
Allow auto-compaction to trigger at a percentage of the model's context window, instead of only an absolute compaction.reserveTokens value.
Problem
Auto-compaction fires when contextTokens > contextWindow - reserveTokens. Because reserveTokens is an absolute token count, the effective trigger point shifts whenever the active model's context window changes.
Example: to compact at ~25% usage I set reserveTokens: 150000 for a 200k-window model (trigger at 50k). Switching to a 1M-window model with the same setting moves the trigger to ~85% (1,000,000 - 150,000 = 850,000). I have to recompute and edit settings every time I change models or window size.
This also makes shared/team settings fragile, since the right value depends on each user's current model.
Proposal
Add a percentage-based threshold option, evaluated against the live context window:
Suggested semantics:
triggerPercent (0-100): compact when contextTokens >= contextWindow * triggerPercent / 100.
- Keep
reserveTokens working as today for backward compatibility.
- If both are set, document precedence (e.g.
triggerPercent wins, or use whichever triggers first).
keepRecentTokens could optionally gain a percentage variant too (keepRecentPercent).
Benefit
One setting that stays correct across models and context-window sizes (including 1M-context models), with no manual recomputation.
Summary
Allow auto-compaction to trigger at a percentage of the model's context window, instead of only an absolute
compaction.reserveTokensvalue.Problem
Auto-compaction fires when
contextTokens > contextWindow - reserveTokens. BecausereserveTokensis an absolute token count, the effective trigger point shifts whenever the active model's context window changes.Example: to compact at ~25% usage I set
reserveTokens: 150000for a 200k-window model (trigger at 50k). Switching to a 1M-window model with the same setting moves the trigger to ~85% (1,000,000 - 150,000 = 850,000). I have to recompute and edit settings every time I change models or window size.This also makes shared/team settings fragile, since the right value depends on each user's current model.
Proposal
Add a percentage-based threshold option, evaluated against the live context window:
Suggested semantics:
triggerPercent(0-100): compact whencontextTokens >= contextWindow * triggerPercent / 100.reserveTokensworking as today for backward compatibility.triggerPercentwins, or use whichever triggers first).keepRecentTokenscould optionally gain a percentage variant too (keepRecentPercent).Benefit
One setting that stays correct across models and context-window sizes (including 1M-context models), with no manual recomputation.