You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature: Configurable compaction threshold and model (global + per-model) #11930
Add configurable compaction settings at both global and per-model levels:
Threshold: Trigger compaction at a percentage of context usage (not just at 100%)
Model: Use a different (cheaper/faster) model for compaction
Motivation
Different models degrade at different context levels - Claude Opus quality drops around 50-60% context, while other models may handle more. Users should be able to tune this per-model.
Compaction can use cheaper models - The compaction summary doesn't need the most expensive model. Users (especially Copilot users) want to use a cheaper model for compaction to save quota/costs.
This current issue (#11930) appears to be a comprehensive feature proposal that builds upon and consolidates these requests. It may be worth reviewing whether to close the older issues as duplicates of this one once it's implemented, or keeping them open for discussion if they represent specific use cases.
yeah same issue, I want to be able to set the model for compaction.
maybe also an early alert when probably it will do the compaction can be handy as there is the issue that now often forgets everything.
One specific part I want to make sure is covered here is prune, not just full summary compaction.
Right now SessionCompaction.prune() uses fixed thresholds:
PRUNE_PROTECT = 40_000
PRUNE_MINIMUM = 20_000
and it runs after each assistant turn. That means old tool outputs can start getting replaced with [Old tool result content cleared] very early, even on long-context models.
On 1M-context models this feels especially aggressive, because full compaction is model-aware but prune is not. So even when the session is nowhere near overflow, older tool outputs may already be gone.
So from my side, the ideal solution here would also include one of:
scaling prune thresholds from model.limit.context
exposing prune knobs such as prune_protect / prune_minimum
otherwise making prune less aggressive automatically on very large-context models
I opened #16285 for this originally, but I'm consolidating the request here since it seems to overlap with this broader compaction-config issue.
Activity
github-actions commentedon Feb 3, 2026
This issue consolidates several related feature requests about compaction configuration. The issues listed are highly relevant and should be reviewed:
This current issue (#11930) appears to be a comprehensive feature proposal that builds upon and consolidates these requests. It may be worth reviewing whether to close the older issues as duplicates of this one once it's implemented, or keeping them open for discussion if they represent specific use cases.
feat(compaction): add configurable threshold and model (global + per-…
absurdly-nerdly commentedon Feb 25, 2026
Yes please, this really is needed, and per-model/per-agent config is a must!
Fridayxiao commentedon Mar 4, 2026
Damn right
Mte90 commentedon Mar 4, 2026
yeah same issue, I want to be able to set the model for compaction.
maybe also an early alert when probably it will do the compaction can be handy as there is the issue that now often forgets everything.
nyl199310 commentedon Mar 6, 2026
One specific part I want to make sure is covered here is
prune, not just full summary compaction.Right now
SessionCompaction.prune()uses fixed thresholds:PRUNE_PROTECT = 40_000PRUNE_MINIMUM = 20_000and it runs after each assistant turn. That means old tool outputs can start getting replaced with
[Old tool result content cleared]very early, even on long-context models.On 1M-context models this feels especially aggressive, because full compaction is model-aware but
pruneis not. So even when the session is nowhere near overflow, older tool outputs may already be gone.So from my side, the ideal solution here would also include one of:
model.limit.contextprune_protect/prune_minimumI opened #16285 for this originally, but I'm consolidating the request here since it seems to overlap with this broader compaction-config issue.
drewbitt commentedon Mar 30, 2026
You can already globally set a specific model for compaction.
#6976 (comment)
The per mode specific compaction percentage feature is much needed though. GLM 5.1 can't get past 60% without generating gibberish.
github-actions commentedon Jun 26, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.