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
CompactionStrategy trait — Pluggable context compaction. Override what happens when messages are compressed: index dropped content into memory, preserve priority messages, insert semantic pointers, or any custom logic. DefaultCompaction wraps the existing 3-level strategy and is used automatically when no custom strategy is set.
Agent::with_compaction_strategy() — Builder method for setting a custom compaction strategy.
DefaultCompaction — Public struct implementing CompactionStrategy that delegates to compact_messages(). Useful for composing inside custom strategies.
Bug Fixes
Fixed flaky test_default_compaction_matches_compact_messages test caused by now_ms() timestamp non-determinism in Level 3 compaction markers.
Documentation
Added "Custom Compaction" section to agent-loop docs with three concrete use-case examples: memory-aware, semantic pointer, and priority-preserving compaction.