feat(cron): convert heartbeat tasks: entries into independent cron jobs (#113165)

Each legacy heartbeat tasks: entry becomes an editable system-created cron
job (declaration key heartbeat-task:<agentId>:<hash>, per-occurrence
identity for duplicate names) that fires a guarded heartbeat wake carrying
the task prompt plus current monitor scratch context. Task cadence is now
independent of the base heartbeat interval; active-hours, busy-retry,
min-spacing, and flood guards are preserved, deferred payload-carrying
wakes are retained and retried after the spacing floor, and colliding
task/event wakes cannot starve each other.

openclaw doctor --fix migrates existing blocks: async parse/plan, then one
synchronous SQLite transaction that rereads the pinned scratch revision,
upserts job rows, and strips the tasks: block atomically — concurrent
doctors serialize on the database and a losing run aborts untouched.
Orphan fields, invalid intervals, and incomplete entries block migration
of their block with a clear finding instead of silent text loss. The
runtime tasks: parser is deleted; leftover text is ordinary scratch prose.

Nine Codex gpt-5.6-sol xhigh autoreview cycles; final verdict clean.
This commit is contained in:
Peter Steinberger
2026-07-23 16:13:08 -07:00
committed by GitHub
parent b3b9e691bd
commit b23c7bd0f8
45 changed files with 2786 additions and 526 deletions
+2 -1
View File
@@ -66,6 +66,7 @@ Do not edit it by hand; run `pnpm docs:map:gen`.
- H2: Quick start
- H2: How cron works
- H2: Schedule types
- H3: Heartbeat task migration
- H3: Stream sources
- H3: Dynamic cadence (pacing)
- H3: Day-of-month and day-of-week use OR logic
@@ -3602,7 +3603,7 @@ Do not edit it by hand; run `pnpm docs:map:gen`.
- H3: Per-channel vs per-account examples
- H3: Common patterns
- H2: Monitor scratch (optional)
- H3: tasks: blocks
- H3: Schedule recurring checks with cron
- H3: Can the agent update its scratch?
- H2: Manual wake (on-demand)
- H2: Cost awareness