diff --git a/.openclaw-sync/source.json b/.openclaw-sync/source.json index 728a12cc9..2648d3e17 100644 --- a/.openclaw-sync/source.json +++ b/.openclaw-sync/source.json @@ -1,5 +1,5 @@ { "repository": "openclaw/openclaw", - "sha": "04be516926da8c44caa402df09d998c72fcb9a7d", - "syncedAt": "2026-04-27T06:43:19.347Z" + "sha": "ddcd9d62c4faed1582e90c1b9d1ac6e7ff7a3af5", + "syncedAt": "2026-04-27T06:47:12.427Z" } diff --git a/docs/automation/cron-jobs.md b/docs/automation/cron-jobs.md index 47c032809..e82549a54 100644 --- a/docs/automation/cron-jobs.md +++ b/docs/automation/cron-jobs.md @@ -43,6 +43,7 @@ Cron is the Gateway's built-in scheduler. It persists jobs, wakes the agent at t - Job definitions persist at `~/.openclaw/cron/jobs.json` so restarts do not lose schedules. - Runtime execution state persists next to it in `~/.openclaw/cron/jobs-state.json`. If you track cron definitions in git, track `jobs.json` and gitignore `jobs-state.json`. - After the split, older OpenClaw versions can read `jobs.json` but may treat jobs as fresh because runtime fields now live in `jobs-state.json`. +- When `jobs.json` is edited while the Gateway is running or stopped, OpenClaw compares the changed schedule fields with pending runtime slot metadata and clears stale `nextRunAtMs` values. Pure formatting or key-order-only rewrites preserve the pending slot. - All cron executions create [background task](/automation/tasks) records. - One-shot jobs (`--at`) auto-delete after success by default. - Isolated cron runs best-effort close tracked browser tabs/processes for their `cron:` session when the run completes, so detached browser automation does not leave orphaned processes behind. @@ -399,6 +400,8 @@ Model override note: The runtime state sidecar is derived from `cron.store`: a `.json` store such as `~/clawd/cron/jobs.json` uses `~/clawd/cron/jobs-state.json`, while a store path without a `.json` suffix appends `-state.json`. +If you hand-edit `jobs.json`, leave `jobs-state.json` out of source control. OpenClaw uses that sidecar for pending slots, active markers, last-run metadata, and the schedule identity that tells the scheduler when an externally edited job needs a fresh `nextRunAtMs`. + Disable cron: `cron.enabled: false` or `OPENCLAW_SKIP_CRON=1`. diff --git a/docs/cli/cron.md b/docs/cli/cron.md index 5e9aaeb3c..40f070200 100644 --- a/docs/cli/cron.md +++ b/docs/cli/cron.md @@ -83,6 +83,8 @@ Recurring jobs use exponential retry backoff after consecutive errors: 30s, 1m, Skipped runs are tracked separately from execution errors. They do not affect retry backoff, but `openclaw cron edit --failure-alert-include-skipped` can opt failure alerts into repeated skipped-run notifications. +Note: cron job definitions live in `jobs.json`, while pending runtime state lives in `jobs-state.json`. If `jobs.json` is edited externally, the Gateway reloads changed schedules and clears stale pending slots; formatting-only rewrites do not clear the pending slot. + ### Manual runs `openclaw cron run` returns as soon as the manual run is queued. Successful responses include `{ ok: true, enqueued: true, runId }`. Use `openclaw cron runs --id ` to follow the eventual outcome.