Skip to content

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

Merged
Tarquinen merged 2 commits intorefactor/one-tool-to-rule-them-allfrom
refactor/structured-compression-state
Feb 27, 2026
Merged

refactor(compress): implement structured compression block state#412
Tarquinen merged 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.
Note: previous persisted compression data is not supported

  • 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
@Tarquinen Tarquinen merged commit afb58b9 into refactor/one-tool-to-rule-them-all Feb 27, 2026
@Tarquinen Tarquinen deleted the refactor/structured-compression-state branch February 27, 2026 23:43
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