Repository navigation
Description
Summary
When upgrading OpenClaw from 2026.5.28 → 2026.6.1 via npm install -g openclaw@2026.6.1, the cron store migrated silently from JSON to SQLite without preserving the previous job config (or at least, the migration is not visible to the user). Additionally, the CLI default for new cron add jobs appears to be delivery: { mode: "announce", channel: "last" }, which fails because no delivery channel is configured in most installations.
This causes all cron jobs to fail with "Channel is required" on every run, even though the jobs themselves are well-formed.
Environment
- OpenClaw version: 2026.6.1 (commit
2e08f0f) - Previous version: 2026.5.28
- Host: macOS 15.4 (arm64), Node v24.14.1
- Install path:
/usr/local/lib/node_modules/openclaw - Cron store path:
~/.openclaw/cron/jobs.json(old) →~/.openclaw/state/openclaw.sqlite(new)
Steps to Reproduce
- Start with OpenClaw 2026.5.28, with 12 cron jobs configured (all with
delivery.mode: "none"). - Upgrade to 2026.6.1:
npm install -g openclaw@2026.6.1
- Restart Gateway:
launchctl kickstart -k gui/501/ai.openclaw.gateway - Run:
openclaw cron list
Expected: All 12 jobs are listed with their next-run times.
Actual: Only 1 job is listed (Memory Dreaming Promotion, which is a memory-core managed job that 6.1 itself added). The other 11 jobs are gone from the schedule, even though jobs.json.bak on disk still contains all 12 entries.
Investigation
Looking at the log file /tmp/openclaw/openclaw-2026-06-04.log:
22:13:40 cron: started (jobs: 12) ← still loading from JSON
22:26:05 cron: started (jobs: 12) ← post-upgrade, still 12
22:31:04 memory-core: created managed dreaming cron job.
22:31:04 cron: job added Memory Dreaming ← only this one added
22:31:04 cron: started (jobs: 1) ← now only 1!
It looks like 6.1's memory-core module overwrote the cron store when it registered the Memory Dreaming Promotion managed job. After that, all 12 original jobs were lost from the schedule, even though the JSON file on disk was not deleted (it was just no longer being read).
The cron store also moved from a flat JSON file to a SQLite database at ~/.openclaw/state/openclaw.sqlite — there is no visible migration path that brings the old jobs.json entries over.
Workaround (how I recovered)
- Manually read all 12 job definitions from
jobs.json.bak(id, schedule, payload, delivery, etc.) - Re-create each one via
openclaw cron addwith the same parameters. - After each add, the default
deliverywas{ mode: "announce", channel: "last" }— this is a separate bug because no channel is configured in this environment, so every cron run would fail with:Channel is required (no configured channels detected). - Fix the delivery on each new job:
openclaw cron update --jobId <id> --patch '{"delivery":{"mode":"none"}}'
- After this,
openclaw cron listshows all 12 jobs and they are scheduled correctly.
Suggested Fixes
Issue A — silent cron store migration
The migration from jobs.json → SQLite should:
- Either auto-import the old JSON entries into the new SQLite store, or
- Print a clear warning during the upgrade (e.g. "Detected legacy jobs.json with 12 entries. Run
openclaw cron migrate-legacyto import them."), or - At minimum, leave the old
jobs.jsonintact and document the manual recovery path in the changelog.
Issue B — default delivery.mode should be none, not announce
When openclaw cron add is called without --announce / --deliver, the resulting job's delivery defaults to { mode: "announce", channel: "last" }. For users who haven't configured a delivery channel (most users on a fresh install), this makes every cron run fail with a Channel is required error.
Suggested fix: default delivery.mode to "none" when no delivery flag is passed, OR detect at run time whether a channel is configured and skip the delivery silently instead of failing the whole job.
Issue C — failed delivery currently fails the whole cron run
Even when the actual payload (the agent turn) succeeds, a failure in the delivery layer currently marks the job run as error and triggers failure alerts. This is the wrong precedence — the work was done; only the announce step failed. The delivery failure should be logged but not bubble up as a job-level error.
Reproduction (minimal)
# fresh install
npm install -g openclaw@2026.6.1
openclaw gateway restart
openclaw cron add --cron "0 6 * * *" --tz "Asia/Shanghai" \
--name "test-job" --session isolated \
--model "minimax-portal/MiniMax-M2.7" \
--message "hello"
# Wait until 06:00, or:
openclaw cron run <jobId>
# → Result: "Channel is required (no configured channels detected)"
# lastStatus: "error"The job's payload runs to completion in the log, but the cron run is marked failed purely because of the default delivery.
Real behavior proof (post-fix)
After patching each job with delivery.mode = "none", the next runs completed successfully:
22:14:30 cron: started (jobs: 12, all enabled, all scheduled)
22:55:00 cron: job run 🧧 大乐透自动运营 → ok
23:00:00 cron: job run 📝 每日自动反思 → ok
The cron subsystem is now healthy and stable on my end.
Related
- OpenClaw changelog entry for 2026.6.1: https://github.com/openclaw/openclaw/releases/tag/v2026.6.1
- This falls under the
cronandgatewaysubsystems — cc @tyler6204 (cron maintainer) and @joshavant (gateway/core maintainer).
Thanks for the great project — happy to send a PR for any of the three fixes if the maintainer team is open to it.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jun 4, 2026
Codex review: this still needs some work. Reviewed October 7, 2026, 12:09 PM ET / 16:09 UTC.
Summary
Keep open as a request to change the documented delivery default, rather than an automatic migration bug repair. The contributor’s proposed PR closed unmerged, and current main still defaults isolated jobs to announce. Later merged work deliberately retains required-delivery failures, so blanket silent delivery would reverse an established contract.
Reproducibility: yes. for the remaining delivery mechanism: source shows isolated CLI jobs default to announce and unresolved required destinations fail. The original 2026.5.28-to-2026.6.1 migration was not executed or independently reproduced.
Maintainer decision needed
Why: Both modes already exist, but choosing their creation default changes operator expectations; the accepted required-delivery contract does not authorize silently selecting none for new jobs.
Next step
Select the new-job delivery policy before implementation; preserve the historical migration reports and use the documented 2026.9.7 Doctor bridge for retired JSON stores.
Review details
Best possible solution:
Preserve existing jobs and required-delivery semantics; use explicit silent or best-effort modes unless maintainers sponsor a narrowly documented change to new-job defaults.
Do we have a high-confidence way to reproduce the issue?
Yes for the remaining delivery mechanism: source shows isolated CLI jobs default to announce and unresolved required destinations fail. The original 2026.5.28-to-2026.6.1 migration was not executed or independently reproduced.
Is this the best way to solve the issue?
No for the blanket proposed change: silent and best-effort modes already exist, and unconditional delivery success conflicts with later accepted completion semantics.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning medium; reviewed against 74ab47aec9ac.
Label changes
Label changes:
clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.clawsweeper:needs-maintainer-review: Current issue advisory state selects this label.Label justifications:
P2: The remaining concern is a bounded delivery-default policy request with existing explicit operational alternatives.impact:message-loss: An unresolved announce destination prevents scheduled output from reaching the intended operator.impact:ux-friction: Local-only operators must discover explicit silent or best-effort delivery settings to avoid unwanted channel failures.Evidence reviewed
What I checked:
src/cli/cron-cli/register.cron-add.ts:315, 74ab47aec9ac)docs/automation/cron-jobs/delivery.md. (docs/automation/cron-jobs/delivery.md:94, 74ab47aec9ac)src/cron/completion-status.ts:65, 13125bf33f20)src/cron/isolated-agent/delivery-dispatch.ts:669, 74ab47aec9ac)docs/automation/cron-jobs/managing-jobs.md. (docs/automation/cron-jobs/managing-jobs.md:236, 74ab47aec9ac)Likely related people:
How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.olveww-dot commentedon Jun 5, 2026
Thanks for the thorough triage @clawsweeper — and for catching the overlap with #90072. Glad to see the labels land where they do.
Here's the patch I'm running locally to fully recover, in case it's useful for the eventual fix. The intent is to keep the runtime 100% behavior-equivalent to a clean
jobs.json-style install from pre-6.1 while staying on the SQLite-backed path.1. One-time legacy import into SQLite
OpenClaw doctor already does this on demand. For users who don't run doctor, the following one-liner migrates a legacy
jobs.jsoninto the SQLite store. I run this immediately after any 5.x → 6.x upgrade:If a
doctor --repair-cron-legacyflag like that doesn't exist yet on 6.1, I'd suggest adding one — see suggested-flag below.2. Fix delivery default for isolated agentTurn jobs
The simplest possible source-level fix to Issue B lives in
src/cli/cron-cli/register.cron-add.ts(around line 265 per the bot's review). Today it setsdeliveryMode = "announce"for isolated jobs that don't pass--announce/--no-deliver. The proposed change is to default to"none"when the user didn't ask for any delivery, and only set"announce"when they explicitly opted in:Mirrored runtime change in
src/cron/delivery-plan.ts(line 98) so that an existingdelivery: undefinedplan also falls through to"none"rather than defaulting toannounceonchannel: "last":3. Don't fail the run when delivery is best-effort and fails
For Issue C, the user-visible behavior should be: the agent turn runs to completion, the result is logged, and only the delivery step is allowed to fail-soft. Concretely, the current
return a cron run erroratsrc/cron/isolated-agent/delivery-dispatch.ts:1210is gated onbestEffort, but I think the implicit expectation is that all isolated jobs are best-effort on the delivery side. Proposed: log the delivery error at WARN, set a per-rundeliveryStatusfield on the run record, but never propagate it as a job-level error.4. Doctor flag suggestion
If maintainers want to make the migration automatic without taking a runtime startup hit, I'd suggest:
Doctor is already trusted for this kind of repair and it avoids the chicken-and-egg of "Gateway won't start because cron store is empty after upgrade".
Real behavior proof on my end
After applying the equivalent of (1) + (2) + (3) above locally:
Twelve jobs survived the 5.28 → 6.1 transition, delivery no longer poisons the run, and the next system-side upgrade from 6.x → 6.y should be a no-op for cron state. If maintainers want me to open these as actual PRs against
main, I'm happy to — just say the word.AgentXaGent commentedon Jun 7, 2026
Adding a corroborating repro on 2026.6.1 (fresh install via
npm i -g openclaw@2026.6.1, Ubuntu 24.04 / Node 22.22.2), with a slightly different surface than OP's that may help triage.My environment
npm i -g openclaw@2026.6.1+openclaw gateway restart.~/.openclaw/cron/jobs.jsonhad 27 jobs, all healthy on 2026.5.20.jobs.json(run logs at~/.openclaw/cron/runs/<id>.jsonlcontinue to append,~/.openclaw/cron/jobs-state.jsonis being updated in real time). So in my case the scheduler did NOT lose the legacy jobs.crontool layer is completely blind to them:cron list→{ "jobs": [], "total": 0 }cron get/update/removeby ID of any pre-upgrade job →"id not found"cron status→ reports0 jobsin the storecron addare immediately visible viacron list/get/update/remove— so the MCP layer index works fine for new entries, it just never rehydrated the legacy ones on boot.Files on disk after upgrade
This pattern strongly suggests the migration is bifurcated: the scheduler core kept reading the legacy JSON file, but the MCP cron tool reads from the new SQLite store, and the migration of pre-existing JSON entries into SQLite never ran (or only ran for the
memory-coremanaged job described above).Operator impact
Different surface than OP's, but same root cause and same severity:
cron list,cron get, status dashboards) shows zero jobs.jobs.jsondirectly while the gateway is running.My workaround (in case it helps others)
~/.openclaw/cron/jobs.jsonto flipenabled: falsefor the job(s) I want to retire, then wait for next gateway restart to drop them from the scheduler core. (Not satisfying — but the MCP API can't see them, so this is the only path.)Suggested addition to your "Suggested Fixes" section
In addition to your three items (auto-import / warning / preserve legacy file), there's a fourth:
jobs.jsonand fires them, the MCPcron list/get/update/removeactions see only SQLite-resident jobs. This means the operator dashboard underreports active crons and provides no way to inspect or mutate the legacy entries.Happy to provide any additional logs/state dumps. Also filed #91228 today for what looks like a related regression —
agentTurnpayload arrives as[object Object]to the isolated agent on 2026.6.1. May share the same SQLite-rehydration root cause.AgentXaGent commentedon Jun 7, 2026
Additional datapoint: I just did a clean gateway restart on 2026.6.1 (loading a plugin update —
brave2026.5.6 → 2026.6.1, plus all ofdoctor's legacy-state migrations had run already on the prior restart). The MCPcron listis still empty for the 27 pre-upgrade jobs.So at least on my install, a restart alone does not trigger rehydration of the legacy
jobs.jsonentries into the MCP-visible store. The bifurcation is sticky:~/.openclaw/cron/jobs.json✓~/.openclaw/cron/jobs-state.json: actively updated post-restart ✓cron listvia MCP / CLI: still{ "jobs": [], "total": 0 }✗Whatever the migration condition is, it's not "next gateway boot" — it appears to need either an explicit migrate command or the
memory-core-style trigger that the OP described. Worth flagging in the eventual fix that pure restart will not heal an already-bifurcated install.NOVA-Openclaw commentedon Jun 8, 2026
Adding data from another affected installation:
Upgrade path: 2026.5.28 → 2026.6.1
Jobs lost: 28 (all user-created cron jobs)
Old store:
~/.openclaw/cron/jobs.json— still intact with all 28 jobsNew store:
~/.openclaw/state/openclaw.sqlitecron_jobs table — 0 rows, 0 run logsSQLite DB birth: 2026-06-07 12:07 UTC (created fresh ~1.3 hours after the v2026.6.1 merge)
Notable:
openclaw doctor --checkdoes not detect the unmigrated jobs.json file or flag the empty cron store as an issue. The migration failure was completely silent — we only discovered it during a diagnostic audit 2 days later when we noticed recurring scheduled work had stopped.The old jobs.json is untouched and we're manually re-importing via the cron tool API. A
openclaw cron import --from-legacycommand or automatic doctor detection would prevent this for other users.Haderach-Ram commentedon Jun 14, 2026
Adding corroborating data from a 14-agent macOS fleet upgrade (2026.5.28 → 2026.6.6, LaunchAgent-managed, Apple Silicon M4).
We hit two distinct manifestations of the same underlying migration bug:
Manifestation A — Scheduler loads 0 jobs on first start (WAL timing)
After
npm install -g openclaw@2026.6.6and LaunchAgent restart, all agents started with 0 cron jobs in memory despitejobs.jsonhaving been migrated tostate/openclaw.sqlite. The SQLite WAL was not committed before the cron scheduler initialised. A second hard restart (launchctl bootout + bootstrap) resolved it — the committed SQLite was found on second start and all jobs loaded correctly. Filed as #93032.Manifestation B — Migrated jobs have blank
agent_id— silently skippedOn agents whose cron jobs were originally created via the flat-file API (not the cron REST/WS endpoint), the migration populated
cron_jobsrows withagent_id = NULL. The v2026.6.6 scheduler filters dispatch byagent_idand silently skips ownerless jobs — no error, no log, jobs just never fire. Fix:UPDATE cron_jobs SET agent_id='main' WHERE agent_id IS NULL OR agent_id = ''. Filed as #93031.Environment:
~/.openclaw-<agent>/home dir and LaunchAgent plistBoth issues resolved with the workarounds above, but the root cause — migration not guaranteeing a committed, scheduler-ready SQLite before first cron init — is the same as reported here. Hope this helps triage.
25 remaining items
steipete commentedon Oct 9, 2026
Thanks for the report. This install predates the retired file-based stores, so it needs the documented bridge release once before moving to current:
The bridge step lets Doctor migrate the retired stores (see https://docs.openclaw.ai/cli/cron). If either Doctor run reports an error, please open a new issue with its output. Closing this as handled by the bridge hop.