Files
cellclaw/app
jordanthejet 1358437359 Add heartbeat system for long-running task persistence
Agent loop previously exited to IDLE when the LLM returned no tool calls,
causing tasks like chess or dating apps to silently stop. This adds a
heartbeat system that periodically wakes the agent to check screen state
and act if needed.

- HeartbeatManager: Handler-based scheduler with exponential backoff
  (5s → 10s → 30s → 60s), renewable wake lock (5 min), active task context
- HeartbeatDetector: Classifies agent responses (HEARTBEAT_OK, acted, error)
- HeartbeatPrompt: Builds [Heartbeat Check] prompts with task context
- heartbeat.context tool: Agent sets/clears monitoring context
- AgentLoop.submitHeartbeat(): Non-cancelling heartbeat entry point with
  invisible event suppression and conversation history pruning
- CellClawService: Heartbeat lifecycle, notification shows monitoring state
- Identity: System prompt sections for screen reading strategy and heartbeat

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 16:00:02 -05:00
..