Skip to content

Cron job with Asia/Shanghai timezone not executing on Feb 5 #9640

@shuans

Description

@shuans

Bug Description

Cron job with schedule 10 21 * * 1-5 (Asia/Shanghai) did not execute on 2026-02-05 (Thursday) at 21:10 CST.

Steps to Reproduce

  1. Create a cron job with expression 10 21 * * 1-5 and timezone Asia/Shanghai
  2. Wait for the scheduled time
  3. Observe that the job does not execute

Expected Behavior

The job should execute at 21:10 CST (UTC+8) on weekdays.

Actual Behavior

The job skipped execution on 2026-02-05 despite the schedule matching.

Job Configuration

{
  "schedule": {
    "kind": "cron",
    "expr": "10 21 * * 1-5",
    "tz": "Asia/Shanghai"
  }
}

Environment

  • OpenClaw version: Latest (2026.2.x)
  • Node.js version: v24.x
  • Timezone: Asia/Shanghai

Investigation

Tested croner library directly:

const cron = new Cron('10 21 * * 1-5', { timezone: 'Asia/Shanghai' });
cron.nextRun(new Date('2026-02-05T13:00:00Z')) // Returns 2026-02-05T13:10:00.000Z ✓

Croner correctly calculates the next run time, suggesting the bug is in OpenClaw's cron service implementation, possibly in timer handling or schedule persistence.

Possible Root Causes

  1. Timer handling in src/cron/service/timer.ts with long timeouts
  2. Schedule persistence/reload logic
  3. computeJobNextRunAtMs not being called correctly after restart

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