Skip to content

[Bug] Cron scheduler skips execution when task is created between scheduled times #10272

@liuguangchao103

Description

@liuguangchao103

Bug Description

When a cron job is created at a time that is not exactly on the scheduled minute (e.g., creating a 0 * * * * task at 13:19), the scheduler skips all subsequent executions until the next day.

Steps to reproduce:

  1. Create a cron job with expression 0 * * * * (every hour at minute 0) at 13:19
  2. The scheduler should execute at 14:00, 15:00, etc.
  3. Instead, the scheduler jumps directly to 16:00 or later, skipping 14:00 and 15:00

Expected behavior:
The scheduler should find the next matching time slot after the task creation time and execute accordingly.

Actual behavior:
The scheduler calculates next run time based on creation timestamp rather than finding the next valid cron match.

Environment:

  • OpenClaw version: 2026.2.1
  • OS: Linux
  • Cron expression: 0 * * * *
  • Task creation time: 13:19 (not on the hour)

Workaround:
Manually recreating the task at exactly the hour mark.

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