🐛 Bug Fixes
Pending Messages Cleanup (Issue #353)
Fixed unbounded database growth in the pending_messages table by implementing proper cleanup logic:
- Content Clearing:
markProcessed()now clearstool_inputandtool_responsewhen marking messages as processed, preventing duplicate storage of transcript data that's already saved in observations - Count-Based Retention:
cleanupProcessed()now keeps only the 100 most recent processed messages for UI display, deleting older ones automatically - Automatic Cleanup: Cleanup runs automatically after processing messages in
SDKAgent.processSDKResponse()
What This Fixes
- Prevents database from growing unbounded with duplicate transcript content
- Keeps metadata (tool_name, status, timestamps) for recent messages
- Maintains UI functionality while optimizing storage
Technical Details
Files Modified:
src/services/sqlite/PendingMessageStore.ts- Cleanup logic implementationsrc/services/worker/SDKAgent.ts- Periodic cleanup calls
Database Behavior:
- Pending/processing messages: Keep full transcript data (needed for processing)
- Processed messages: Clear transcript, keep metadata only (observations already saved)
- Retention: Last 100 processed messages for UI feedback
Related
- Fixes #353 - Observations not being saved
- Part of the pending messages persistence feature (from PR #335)
Full Changelog: v7.3.0...v7.3.1