OpenClaw Cron Job Issue Report
Issue Title
Cron job manual execution fails with TypeError: Cannot read properties of undefined (reading 'startsWith')
Issue Body
Describe the bug
When manually executing a cron job from the OpenClaw Control UI, the job fails with the error:
TypeError: Cannot read properties of undefined (reading 'startsWith')
To Reproduce
Steps to reproduce the behavior:
- Create a cron job in
/home/node/.openclaw/cron/jobs.json with the following configuration:
{
"version": 1,
"jobs": [
{
"id": "daily-news-001",
"name": "daily-news-morning",
"description": "每日新闻摘要(早间版)",
"enabled": true,
"createdAtMs": 1776530000000,
"updatedAtMs": 1776530000000,
"runTimeoutSeconds": 900,
"schedule": {
"kind": "cron",
"expr": "30 8 * * *",
"tz": "Asia/Shanghai"
},
"sessionTarget": "default",
"wakeMode": "now",
"payload": {
"kind": "agentTurn",
"message": "使用 Tavily Search 搜索每日新闻:国际热点,体育热点,科技热点,社会热点。整理成结构化摘要后发送到飞书。"
},
"delivery": {
"mode": "push"
},
"state": {
"nextRunAtMs": 1776529800000
}
}
]
}
- Go to OpenClaw Control UI → Cron Jobs tab
- Click the "Execute" button to manually run the job
- See error:
TypeError: Cannot read properties of undefined (reading 'startsWith')
Expected behavior
The cron job should execute successfully and send the news summary to the target channel.
Actual behavior
The job is skipped with the error message and status shows "未知" (unknown).
Environment
- OpenClaw version: 2026.4.15 (latest)
- Operating system: Linux (Docker container)
- Node version: v24.14.0
Additional context
- The JSON configuration is valid (verified with
python3 -c "import json; json.load(open('jobs.json'))")
- The
sessionTarget field is set to "default" as required
- The
delivery mode is set to "push"
- Restarting the gateway (
openclaw gateway restart) does not resolve the issue
- The error appears to originate from internal code that calls
.startsWith() on an undefined variable
- This affects all cron jobs, not just a specific one
Possible root cause
Looking at the error message, it seems like the internal code is trying to call .startsWith() method on a variable that is undefined. This could be:
sessionTarget validation logic
payload format validation
agentId parsing logic
Screenshot
N/A (error message: "daily-news-digest-002 · 已跳过 TypeError: Cannot read properties of undefined (reading 'startsWith') 未知")
Labels to add
Repository
https://github.com/openclaw/openclaw
OpenClaw Cron Job Issue Report
Issue Title
Cron job manual execution fails with
TypeError: Cannot read properties of undefined (reading 'startsWith')Issue Body
Describe the bug
When manually executing a cron job from the OpenClaw Control UI, the job fails with the error:
To Reproduce
Steps to reproduce the behavior:
/home/node/.openclaw/cron/jobs.jsonwith the following configuration:{ "version": 1, "jobs": [ { "id": "daily-news-001", "name": "daily-news-morning", "description": "每日新闻摘要(早间版)", "enabled": true, "createdAtMs": 1776530000000, "updatedAtMs": 1776530000000, "runTimeoutSeconds": 900, "schedule": { "kind": "cron", "expr": "30 8 * * *", "tz": "Asia/Shanghai" }, "sessionTarget": "default", "wakeMode": "now", "payload": { "kind": "agentTurn", "message": "使用 Tavily Search 搜索每日新闻:国际热点,体育热点,科技热点,社会热点。整理成结构化摘要后发送到飞书。" }, "delivery": { "mode": "push" }, "state": { "nextRunAtMs": 1776529800000 } } ] }TypeError: Cannot read properties of undefined (reading 'startsWith')Expected behavior
The cron job should execute successfully and send the news summary to the target channel.
Actual behavior
The job is skipped with the error message and status shows "未知" (unknown).
Environment
Additional context
python3 -c "import json; json.load(open('jobs.json'))")sessionTargetfield is set to"default"as requireddeliverymode is set to"push"openclaw gateway restart) does not resolve the issue.startsWith()on an undefined variablePossible root cause
Looking at the error message, it seems like the internal code is trying to call
.startsWith()method on a variable that isundefined. This could be:sessionTargetvalidation logicpayloadformat validationagentIdparsing logicScreenshot
N/A (error message: "daily-news-digest-002 · 已跳过 TypeError: Cannot read properties of undefined (reading 'startsWith') 未知")
Labels to add
Repository
https://github.com/openclaw/openclaw