fix: implement pending_messages cleanup to prevent unbounded growth

Fixes #353 - Observations not being saved due to incomplete pending messages implementation

Changes:
- PendingMessageStore.markProcessed() now clears tool_input and tool_response
- PendingMessageStore.cleanupProcessed() changed from time-based to count-based retention
- Keeps most recent 100 processed messages for UI display
- SDKAgent.processSDKResponse() calls cleanup after marking messages processed

This prevents the database from growing unbounded with duplicate transcript data.
The pending_messages table now only stores full transcripts for pending/processing
messages, while processed messages keep metadata only.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Alex Newman
2025-12-16 16:45:04 -05:00
parent f7c0840a35
commit d6cd9e6059
4 changed files with 71 additions and 39 deletions
+4
View File
@@ -76,3 +76,7 @@ Settings are managed in `~/.claude-mem/settings.json`. The file is auto-created
**Public Docs**: https://docs.claude-mem.ai (Mintlify)
**Source**: `docs/public/` - MDX files, edit `docs.json` for navigation
**Deploy**: Auto-deploys from GitHub on push to main
# Important
No need to edit the changelog ever, it's generated automatically.