Skip to content

Conversation

@Tarquinen
Copy link
Collaborator

Summary

  • Detect compaction by analyzing message metadata rather than relying on events
  • Clear tool caches on compaction and add stale entry warning for reliability

- Scan messages for assistant messages with info.summary === true
- Run compaction detection on every checkSession call, not just init
- Remove session.compacted event handler (no longer needed)
- Remove lastCompacted from persistence (derived from messages now)
- Remove unused checkForCompaction function

This ensures compaction is detected even when:
- Plugin was disabled during compaction
- Session was loaded before plugin was installed
- Any other case where the event wasn't captured
- Clear toolParameters and prune.toolIds when compaction is detected
- Add warning log when tool is in cache but not in toolIdList
- Stale tool data from pre-compaction no longer lingers in state
@Tarquinen Tarquinen merged commit 3428541 into dev Dec 17, 2025
1 check passed
@Tarquinen Tarquinen deleted the feature/message-based-compaction-detection branch December 17, 2025 08:54
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.

2 participants