-
Notifications
You must be signed in to change notification settings - Fork 2
Tiered context compaction: soft at 70%, hard at 90% #1338
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or requestresearchResearch-driven improvementResearch-driven improvement
Description
Research
Current compaction triggers at compaction_threshold = 0.80. Industry best practices recommend:
- Soft compaction at 70%: apply deferred tool summaries, compress old tool outputs (10:1+ ratio)
- Hard compaction at 90%: aggressive summarization, strip recoverable content
- Different compression ratios per content type: conversation (3:1-5:1) vs tool outputs (10:1-20:1)
Current state: deferred_apply_threshold = 0.70 already exists, but compaction itself is single-threshold and not type-aware.
Proposal
- Add per-category compression targets (conversation vs tool output vs retrieved context)
- Strip recoverable information during compaction (file contents agent can re-fetch)
- Make summarization aggressiveness increase with message age
Sources
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestresearchResearch-driven improvementResearch-driven improvement