Skip to content

refactor(compress): implement structured compression block state#412

Open
Tarquinen wants to merge 2 commits intorefactor/one-tool-to-rule-them-allfrom
refactor/structured-compression-state
Open

refactor(compress): implement structured compression block state#412
Tarquinen wants to merge 2 commits intorefactor/one-tool-to-rule-them-allfrom
refactor/structured-compression-state

Conversation

@Tarquinen
Copy link
Collaborator

@Tarquinen Tarquinen commented Feb 26, 2026

Summary

Fixes all /undo behavior. When users undo back to a previous prompt, any compressions will also be undone.

  • Replace flat prune.messages map with structured CompressionBlock state.
  • Add syncCompressionBlocks to reconcile block state across sessions and message mutations.
  • Update compress-utils and compress tools to build and apply rich block state including effectiveMessageIds and effectiveToolIds.
  • Fix stats, context, and notification logic to accurately calculate metrics based on active blocks instead of flat map sizes.
  • Handle state persistence and initialization for the new structured format.

- Replace flat `prune.messages` map with structured `CompressionBlock` state.
- Add `syncCompressionBlocks` to reconcile block state across sessions and message mutations.
- Update `compress-utils` and `compress` tools to build and apply rich block state including `effectiveMessageIds` and `effectiveToolIds`.
- Fix `stats`, `context`, and `notification` logic to accurately calculate metrics based on active blocks instead of flat map sizes.
- Handle state persistence and initialization for the new structured format.
@Tarquinen Tarquinen changed the base branch from master to refactor/one-tool-to-rule-them-all February 26, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant