Skip to content

Cron scheduler doesn't wake for newly added 'at' jobs #9565

@thisischappy

Description

@thisischappy

Summary

When adding a new one-time at cron job, the scheduler's nextWakeAtMs is not recalculated. If the new job's scheduled time is sooner than the current next wake, the job will be skipped entirely.

Repro Steps

  1. At 7:00 PM, create two one-time at jobs scheduled for 1:00 AM and 2:00 AM
  2. Verify jobs are created successfully (they appear in cron list)
  3. Wait until after 2:00 AM
  4. Check job state — jobs have empty state ({}), never ran
  5. cron status shows nextWakeAtMs jumped to 7:00 AM (the next recurring cron), skipping the 1am/2am jobs

Expected Behavior

When a new at job is added, if its atMs is sooner than the current nextWakeAtMs, the scheduler should update its wake time to fire for the new job.

Actual Behavior

The scheduler's nextWakeAtMs is not updated when new jobs are added. One-time at jobs scheduled between now and the next recurring cron are silently skipped.

Additional Notes

  • Manual cron run on the missed jobs returns {"ran": false, "reason": "not-due"} because the time has passed
  • Jobs remain in the list with empty state indefinitely
  • This affects the Evening Build Planning workflow where overnight build tasks are approved and scheduled for 1-2am

Environment

  • OpenClaw version: 2026.2.2-3
  • macOS (arm64)

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