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

File diff suppressed because one or more lines are too long