-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
[Bug] Upgrading from 5.28 → 6.1: cron store migrated to SQLite silently, but new jobs default to delivery.mode=announce causing channel errors #90378
Copy link
Copy link
Open
Labels
P0Emergency: data loss, security bypass, crash loop, or unusable core runtime.Emergency: data loss, security bypass, crash loop, or unusable core runtime.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:data-lossCan lose, corrupt, or silently drop user/session/config data.Can lose, corrupt, or silently drop user/session/config data.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Metadata
Metadata
Assignees
Labels
P0Emergency: data loss, security bypass, crash loop, or unusable core runtime.Emergency: data loss, security bypass, crash loop, or unusable core runtime.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:data-lossCan lose, corrupt, or silently drop user/session/config data.Can lose, corrupt, or silently drop user/session/config data.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Give feedbackNo fields configured for issues without a type.
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 newcron addjobs appears to bedelivery: { 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
2e08f0f)/usr/local/lib/node_modules/openclaw~/.openclaw/cron/jobs.json(old) →~/.openclaw/state/openclaw.sqlite(new)Steps to Reproduce
delivery.mode: "none").launchctl kickstart -k gui/501/ai.openclaw.gatewayopenclaw cron listExpected: All 12 jobs are listed with their next-run times.
Actual: Only 1 job is listed (
Memory Dreaming Promotion, which is amemory-coremanaged job that 6.1 itself added). The other 11 jobs are gone from the schedule, even thoughjobs.json.bakon disk still contains all 12 entries.Investigation
Looking at the log file
/tmp/openclaw/openclaw-2026-06-04.log:It looks like 6.1's
memory-coremodule overwrote the cron store when it registered theMemory Dreaming Promotionmanaged 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 oldjobs.jsonentries over.Workaround (how I recovered)
jobs.json.bak(id, schedule, payload, delivery, etc.)openclaw cron addwith the same parameters.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: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:openclaw cron migrate-legacyto import them."), orjobs.jsonintact and document the manual recovery path in the changelog.Issue B — default
delivery.modeshould benone, notannounceWhen
openclaw cron addis called without--announce/--deliver, the resulting job'sdeliverydefaults 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 aChannel is requirederror.Suggested fix: default
delivery.modeto"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 aserrorand 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)
The job's
payloadruns 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:The cron subsystem is now healthy and stable on my end.
Related
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.