Skip to content

Heartbeats and a run watchdog - #95

Merged
danielehrhardt merged 1 commit into
mainfrom
godmode/heartbeats
Oct 6, 2026
Merged

danielehrhardt merged 1 commit into
mainfrom
godmode/heartbeats

Conversation

@danielehrhardt

Copy link
Copy Markdown
Contributor

Agents wake on their own rhythm and keep their work moving between prompts, inspired by Paperclip's heartbeats.

Heartbeat (per agent, new Heartbeat tab)

  • Interval of 15 min to daily, optional working hours and weekdays only, plus a standing checklist.
  • Every beat looks at the agent's tickets. It wakes the agent on the ones it can move forward, each in the ticket's own chat with what changed since it last worked on it: in progress with nothing running, failed for a reason another try may fix (once per block), or never started.
  • It then runs the checklist in a reused Heartbeat chat, with the board and the changes since the last beat.
  • Each beat is recorded with its outcome (woke, quiet, skipped, failed). Quiet beats start no run and cost nothing.
  • Wake prompts require durable progress: a result, a task_note, a follow-up, or task_report_blocked naming who must act.
  • Orchestrators can set heartbeats through agent_create and agent_update.

Watchdog (Settings > AI, on by default)

  • Stops a run with no output for 20 min. A running tool step gets 3x as long (at least 30 min). Delegation and asking the human never count.
  • Stops a run that repeats the same step with the same input and result 6 times in a row.
  • The run fails with a precise report: which step, what input, how long, how many steps.
  • Board tickets retry once (stalled is a new retryable run end), heartbeat checklist runs continue once, and anything else is escalated with a notification. Interventions are listed on the agent's Heartbeat tab.

Tests

  • test/heartbeats.test.ts: 18 tests covering the schedule maths, quiet/stalled/retry/checklist beats, the sweep, the API, watchdog stall and loop detection, the chat escalation and the ticket retry then block.
  • Full core suite: 1561 pass, 1 fail. The failure is the pre-existing folders.test failure, which also fails on main.
  • pnpm -r typecheck and mobile tsc are clean.
Heartbeat tab Beats and watchdog

Agents can switch on a heartbeat: they wake on their own rhythm (15 min to
daily, optional working hours and weekdays), wake themselves on tickets that
stand still, failed or never started (in the ticket's own chat, with what
changed since), run a standing checklist in a Heartbeat chat, and leave a
trail of beats. Quiet beats start no run.

The watchdog stops runs that show no sign of life or repeat the same step
with the same result, with a report of where they stood. Board tickets try
again once; other runs are escalated with a notification.
@danielehrhardt
danielehrhardt merged commit cf59e88 into main Oct 6, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant