feat(daemon): Add circuit breaker for stuck agents (gt-72cqu)

- Add Refinery monitoring to daemon heartbeat (ensureRefineriesRunning)
- Add circuit breaker: agents marked dead by checkStaleAgents() are
  now force-killed and restarted, even if Claude process is alive
- Fixes zombie Claude sessions that werent updating their bead state

The circuit breaker flow:
1. Agent gets stuck (stops updating bead state)
2. After 15 minutes: checkStaleAgents() marks bead as dead
3. On next heartbeat: ensure*Running() sees state=dead
4. Force-kill session and restart fresh

Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
rictus
2026-01-03 13:12:39 -08:00
committed by beads/crew/dave
parent bf6b8b8c92
commit 40b8dec2a0
3 changed files with 5453 additions and 4719 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
gt-9bm3j
gt-gastown-polecat-warboy