MaybeCompact relied on RAM count which resets to 0 on restart (LoadFromDB is a no-op). Messages accumulated in DB but never triggered compaction. Now falls back to CountByKey DB query when RAM count is below threshold.
- Add channel_pending_messages table with UUID v7 PK, sender_id tracking - Implement PendingMessageStore interface with batched flush (3s/20 msgs) - Add LLM-based auto-compaction when entries exceed threshold (50) - Wire persistent history into all channel factories (Telegram, Discord, Slack, Feishu, Zalo) - Extract channel type constants (TypeTelegram, TypeDiscord, etc.) to eliminate magic strings - Add HTTP API endpoints for pending messages management (list, view, compact, clear) - Add Pending Messages dashboard page with group titles resolved from session metadata - Track sender_id across entire pipeline (migration → store → history → handlers)