-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
v2026.6.5: Cron doctor preflight overwrites API-updated schedules with stale legacy JSON data #91944
Copy link
Copy link
Open
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request 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:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.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.
Description
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request 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:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.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
Priority
None yet
Version: 2026.6.5
Summary:
After upgrading to 2026.6.5, a cron job that had its schedule updated via the
cron.updateAPI was triggered at the wrong time on gateway restart — based on the old schedule stored in a legacy JSON file, not the updated SQLite record.Steps to reproduce:
.migratedfile remains on disk as migration artifact)cron.updateAPI (e.g.,18 15 10 * *→18 15 11 * *)cron_jobstable shows new schedule, updatednext_run_at_ms)jobs.json.migratedfile which still contains the OLD scheduleLog evidence from
/tmp/openclaw/openclaw-YYYY-MM-DD.log:The legacy JSON file had the old schedule; the SQLite had the new one. The doctor migration picked the stale version.
Root cause:
The
doctor preflightcron migration reads from legacy JSON stores without checking whether the corresponding SQLite record already has newer data (e.g., by comparingcron_jobs.updated_atagainst the JSON file's mtime, or checking if the SQLite record exists at all for a given job ID).Suggested fix:
cron_jobsSQLite tablecron_jobs.updated_at > source_file.mtime, skip the migration for that job.migratedfiles as truly done and never re-read them during doctor preflightImpact:
For users who have updated cron schedules via the API after the initial JSON→SQLite migration, upgrading to 2026.6.5 can cause cron jobs to fire unexpectedly at the wrong time based on stale schedule data. This is particularly dangerous for scheduled outbound messaging jobs.