Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
openclaw cron add --at "HH:MM" --tz <IANA> fails with "Invalid --at" because time-only strings (HH:MM) are not recognized by the parser. Additionally, --tz has no effect on --at even when using supported datetime formats, making timezone-aware one-shot scheduling non-intuitive from the CLI.
This is a common UX pattern �� users expect --at "09:00" --tz Asia/Shanghai to "just work", similar to how crontab.guru and most scheduling tools handle local times.
Affects: all users who use cron add --at with time-only strings or --tz.
Steps to reproduce
# Attempt: time-only string
openclaw cron add --name "test" --at "09:00" --tz "Asia/Shanghai" --message "hello"
# Error: Invalid --at; use ISO time or duration like 20m
Expected behavior
--at "09:00" --tz Asia/Shanghai should schedule the job at 09:00 in the given timezone today. At minimum, the error message should clearly state what formats are accepted.
Actual behavior
Bug 1 �� HH:MM not supported at all:
src/cron/parse.ts normalizeUtcIso() only handles three patterns:
YYYY-MM-DD �� appends T00:00:00Z
YYYY-MM-DDTHH:MM �� appends Z
- strings with timezone suffix (
Z / +08:00) �� pass through
A bare HH:MM string falls through all branches, is returned unchanged, and Date.parse("09:00") returns NaN on most platforms. Result: parseAbsoluteTimeMs returns null �� parseAt returns null �� CLI throws "Invalid --at".
Bug 2 �� --tz silently ignored for --at:
src/cli/cron-cli/shared.ts parseAt() only applies timezone when isOffsetlessIsoDateTime(raw) is true. That regex is /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/ �� time-only strings never reach the timezone branch. The --help text says --tz is "Timezone for cron expressions", implying it only applies to --cron. But users naturally expect --at "09:00" --tz Asia/Shanghai to work.
Relevant code
src/cron/parse.ts �� normalizeUtcIso() and parseAbsoluteTimeMs()
src/cli/cron-cli/shared.ts �� parseAt()
src/cli/cron-cli/schedule-options.ts �� resolveDirectSchedule()
Suggested fix
- Add
HH:MM / HH:MM:SS pattern support: when --tz is provided and input matches HH:MM, resolve it as today's wall-clock time in that timezone
- Update
--help text to clarify --tz scope (applies to --cron and offset-less --at, not bare time strings)
Workaround
Use a full ISO datetime with explicit UTC offset instead:
openclaw cron add --at "2026-04-02T01:00:00Z" --message "hello"
(Manually convert your local time to UTC first)
Related
Environment
- OpenClaw: checked against main branch
- Node.js: v22.12.0
- OS: Linux (sandbox)
- Reproduction: consistent
Suggested labels: bug, cli, ux
Related: #70046
Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
openclaw cron add --at "HH:MM" --tz <IANA>fails with "Invalid --at" because time-only strings (HH:MM) are not recognized by the parser. Additionally,--tzhas no effect on--ateven when using supported datetime formats, making timezone-aware one-shot scheduling non-intuitive from the CLI.This is a common UX pattern �� users expect
--at "09:00" --tz Asia/Shanghaito "just work", similar to how crontab.guru and most scheduling tools handle local times.Affects: all users who use
cron add --atwith time-only strings or--tz.Steps to reproduce
Expected behavior
--at "09:00" --tz Asia/Shanghaishould schedule the job at 09:00 in the given timezone today. At minimum, the error message should clearly state what formats are accepted.Actual behavior
Bug 1 ��
HH:MMnot supported at all:src/cron/parse.tsnormalizeUtcIso()only handles three patterns:YYYY-MM-DD�� appendsT00:00:00ZYYYY-MM-DDTHH:MM�� appendsZZ/+08:00) �� pass throughA bare
HH:MMstring falls through all branches, is returned unchanged, andDate.parse("09:00")returnsNaNon most platforms. Result:parseAbsoluteTimeMsreturnsnull��parseAtreturnsnull�� CLI throws "Invalid --at".Bug 2 ��
--tzsilently ignored for--at:src/cli/cron-cli/shared.tsparseAt()only applies timezone whenisOffsetlessIsoDateTime(raw)is true. That regex is/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/�� time-only strings never reach the timezone branch. The--helptext says--tzis "Timezone for cron expressions", implying it only applies to--cron. But users naturally expect--at "09:00" --tz Asia/Shanghaito work.Relevant code
src/cron/parse.ts��normalizeUtcIso()andparseAbsoluteTimeMs()src/cli/cron-cli/shared.ts��parseAt()src/cli/cron-cli/schedule-options.ts��resolveDirectSchedule()Suggested fix
HH:MM/HH:MM:SSpattern support: when--tzis provided and input matchesHH:MM, resolve it as today's wall-clock time in that timezone--helptext to clarify--tzscope (applies to--cronand offset-less--at, not bare time strings)Workaround
Use a full ISO datetime with explicit UTC offset instead:
(Manually convert your local time to UTC first)
Related
--tzhelp text improvement: [Docs/UX]: help text is misleading — says "cron expressions" only, but should also apply to datetime strings #59456 / fix(cli): clarify --tz help text for offset-less --at values #69975Environment
Related: #70046