Skip to content

Watchdog / heartbeat: anti-stall for long autonomous runs (design spec)#102

Merged
SamPlvs merged 1 commit into
mainfrom
feat/agent-watchdog-heartbeat
Jul 5, 2026
Merged

Watchdog / heartbeat: anti-stall for long autonomous runs (design spec)#102
SamPlvs merged 1 commit into
mainfrom
feat/agent-watchdog-heartbeat

Conversation

@SamPlvs

@SamPlvs SamPlvs commented Jul 5, 2026

Copy link
Copy Markdown
Owner

What

Adds a design spec (RFC) for an orchestrator-owned watchdog / heartbeat that closes an idle-stall hole in long autonomous runs.

specs/watchdog.md.

Why

The lead-orchestrator is event-driven — it acts on messages from the human or teammates. That has a silent-death hole: when every teammate goes idle (or a spawn dies silently), no message is emitted, so the orchestrator gets no wake signal and is never re-invoked. A long background job (training run, sweep, external CI) emits no agent message while it runs either. Net: "wait for the next message" degrades into "do nothing, indefinitely" — the run looks alive but has flat-lined. This was observed in the wild: a full team stalled silently for ~38h before the human noticed.

This is distinct from context saturation (already handled by checkpoint→respawn). This is idle-stall.

Design (summary)

  • Heartbeat tick — recurring off-minute self-invoke (*/17 * * * *), re-armed each session, independent of teammate messages.
  • Liveness by evidence — pgrep the real PID + artifact/heartbeat deltas; never infer progress from absence of bad news.
  • Long-job monitor — stream a job's log filtered on progress and failure signatures (silence-is-not-success).
  • Remediation escalation — nudge → respawn-from-checkpoint → reroute to a reliable executor; never silently truncate.
  • No single point of failure — the heartbeat is owned by the run itself, not a killable monitor agent.

Scope

Spec-only. Code + tests + orchestrator/comms wiring land in a follow-up implementation PR against this spec.

Test

N/A (spec). Acceptance criteria for the implementation are enumerated in §5.

🤖 Generated with Claude Code

Design spec (RFC) for an orchestrator-owned watchdog that closes the
idle-stall hole: an event-driven lead receives no wake signal when every
teammate goes idle or a background job dies silently, so a run can flat-line
unnoticed. Spec covers a scheduled heartbeat tick, evidence-based liveness
(pgrep + artifact deltas, not absence-of-bad-news), a long-job failure-aware
monitor, remediation escalation (nudge -> respawn -> reroute), config, and
integration points. Implementation follows in a separate PR.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying zero-operators with  Cloudflare Pages  Cloudflare Pages

Latest commit: 81cb101
Status: ✅  Deploy successful!
Preview URL: https://a58bf737.zero-operators.pages.dev
Branch Preview URL: https://feat-agent-watchdog-heartbea.zero-operators.pages.dev

View logs

@SamPlvs
SamPlvs merged commit 297adac into main Jul 5, 2026
5 checks passed
@SamPlvs
SamPlvs deleted the feat/agent-watchdog-heartbeat branch July 5, 2026 16:31
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