Skip to content

Tiered context compaction: soft at 70%, hard at 90% #1338

@bug-ops

Description

@bug-ops

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

  1. Add per-category compression targets (conversation vs tool output vs retrieved context)
  2. Strip recoverable information during compaction (file contents agent can re-fetch)
  3. Make summarization aggressiveness increase with message age

Sources

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestresearchResearch-driven improvement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions