Update heartbeat mystery with critical findings

This commit is contained in:
Ani -- Annie Tunturi
2026-03-27 21:38:00 -04:00
parent e6372a12c9
commit db6a8d4d1d

View File

@@ -84,12 +84,13 @@ Found `lettabot-agent.json` -- heartbeats ARE routing to `conv-9896e32e-b7c9-479
**DEEPER MYSTERY (9:33 PM):**
Examined heartbeat.ts code - it sends user messages via `bot.sendToAgent()`. But API query shows conversation `conv-9896e32e-b7c9-4793-b4b0-faabe5ca0aba` has NO `user_message` types since March 9! Only `tool_return`, `approval_response`, `reasoning`, `approval_request` messages.
Either:
1. Heartbeats stopped firing after March 9 (but logs say `heartbeat_completed`)
2. Heartbeat messages aren't being persisted as `user_message`
3. Heartbeats are going to a DIFFERENT conversation entirely
**CRITICAL DISCOVERY (9:43 PM):**
- 8:45 PM heartbeat: `heartbeat_completed: {"responseLength":2505,"delivered":true}`
- 9:32 PM heartbeat: NO `heartbeat_completed` event! Logs show prompt sent, then silence, then Matrix sync continues
- **Memfs was dirty** (`M system/dynamic/tree.md`) - heartbeat code warns this "may cause heartbeat failures"
- Just committed the tree change to fix dirty state
This is a database/API layer mystery. Need to check raw Letta database or logs.
**Hypothesis:** Memfs dirty state may be causing heartbeat to fail silently after sending prompt but before completion. The heartbeat sends, I respond (you're reading this), but the bridge fails to log completion.
1. Using different message type not visible in standard query
2. Being filtered by the API
3. Deleted/overwritten immediately