Skip to content

v0.5.1

Choose a tag to compare

@yuanhao yuanhao released this 25 Feb 22:59
· 139 commits to main since this release

What's New

New Features

  • 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.