-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Open
Description
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.
Proposed Solution
Global config
{
"compaction": {
"auto": true,
"prune": true,
"threshold": 80,
"model": "anthropic/claude-haiku-3-5-20241022"
}
}Per-model config
{
"provider": {
"anthropic": {
"models": {
"claude-opus-4-20250514": {
"compaction_threshold": 50,
"compaction_model": "zhipu/glm-4-plus"
}
}
}
}
}Priority hierarchy
- Per-model
compaction_threshold/compaction_model(highest) - Global
compaction.threshold/compaction.model - Default: 100% threshold, same model as session
Related Issues
- Feature Request: Configurable Context Compaction Threshold #11314 - Configurable Context Compaction Threshold
- Feature Request: Configurable context limit and auto-compaction threshold #8140 - Configurable context limit and auto-compaction threshold
- Feature Request: Custom compaction threshold to trigger earlier #10017 - Custom compaction threshold to trigger earlier
- About the model settings used for automatic compaction #8629 - Model settings for automatic compaction (use cheaper model)
Metadata
Metadata
Assignees
Labels
No labels