Skip to content

Cron job update calculates nextRunAtMs 24 hours late #11246

@meepbot-oss

Description

@meepbot-oss

Summary

When updating a cron job after its daily scheduled time has passed, the nextRunAtMs is incorrectly set to 24 hours later than expected, causing the job to skip the next day's run.

Steps to Reproduce

  1. Create a cron job with schedule 25 6 * * * (6:25 AM daily) in timezone America/New_York
  2. Update the job at 10:37 PM on Feb 6, 2026
  3. Observe nextRunAtMs in the job state

Expected Behavior

  • nextRunAtMs should be Feb 7, 2026 at 6:25 AM EST (~7.8 hours after update)

Actual Behavior

  • nextRunAtMs is Feb 8, 2026 at 6:25 AM EST (~31.8 hours after update)
  • The job skips Feb 7 entirely

Investigation

The croner library correctly calculates the next run:

const { Cron } = require('croner');
const updateTime = new Date('2026-02-06T22:37:00-05:00');
const cron = new Cron('25 6 * * *', { timezone: 'America/New_York' });
cron.nextRun(updateTime); // Returns Feb 7, 2026 6:25 AM EST ✓

But the stored nextRunAtMs is exactly 86,400,000ms (24 hours) off. The bug appears to be in OpenClaw's update flow, not croner itself.

Environment

  • OpenClaw: 2026.2.3-1 (d84eb46)
  • Node.js: v25.5.0
  • OS: macOS Darwin 24.6.0

Workaround

After updating a daily cron job, manually trigger it if nextRunAtMs seems too far in the future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions