-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
[Bug]: cron CLI accepts sub-millisecond positive durations as 0ms #100306
Copy link
Copy link
Closed
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.
Type
Fields
Priority
None yet
Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
The cron CLI accepts positive sub-millisecond durations such as
0.5ms, then floors them to0msbefore sending schedule or failure-alert settings.Steps to reproduce
mainat824d8af0d612fa9e29b910653ac98f6a7495c222, inspectsrc/cli/cron-cli/shared.ts.parseDurationMs("0.5ms")matches the positive duration regex and computesMath.floor(0.5 * 1).Expected behavior
A positive duration that rounds down to
0msshould be rejected, matching the existing rejection of0s, so CLI flags do not silently create zero-duration settings.Actual behavior
0.5msis accepted by the parser and returned as0, allowing callers to build zero-millisecond schedule metadata or cooldown values from a user-supplied positive duration.OpenClaw version
Current
mainat824d8af0d612fa9e29b910653ac98f6a7495c222, source-level repro.Operating system
Not OS-specific.
Install method
Source checkout /
pnpm dev.Model
Not provider-specific; source-level CLI path.
Provider / routing chain
Not provider-specific; source-level CLI path.
Additional provider/model setup details
Not applicable.
Logs, screenshots, and evidence
src/cli/cron-cli/shared.tsparses cron CLI durations with/^(\d+(?:\.\d+)?)(ms|s|m|h|d)$/i, rejectsn <= 0, then returnsMath.floor(n * factor)without verifying the floored result is still positive.Existing tests in
src/cli/cron-cli/shared.test.tsreject0s, negative values, malformed values, and overflow, but do not cover positive sub-millisecond inputs that floor to zero.Duplicate checks found no open issue or PR for:
cron 0.5ms duration cooldown stagger everycron duration rounds to zerofailure alert cooldown 0msImpact and severity
Affected: users editing or creating cron schedules/failure alerts with CLI duration flags.
Severity: Low; edge-case input silently becomes a zero-duration value instead of being rejected.
Frequency: Always for positive duration values below
1ms, such as0.5ms.Consequence: Cron schedule metadata or failure alert cooldowns can be created with an unintended
0msvalue.Additional information
NOT_ENOUGH_INFO