fix(cron): reject sub-millisecond durations#100311
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 5, 2026, 2:09 PM ET / 18:09 UTC. Summary PR surface: Source 0, Tests +2. Total +2 across 2 files. Reproducibility: yes. at source level: current main's cron parser floors Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Next step before merge
Security Review detailsBest possible solution: Land this standalone parser guard with focused regression tests, or close it only if an equivalent fix lands first through the batch PR. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main's cron parser floors Is this the best way to solve the issue? Yes. The shared cron parser guard is the narrowest maintainable fix because it preserves caller contracts and avoids duplicating zero-duration checks in each CLI option path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c757675f348d. Label changesLabel justifications:
Evidence reviewedPR surface: Source 0, Tests +2. Total +2 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (6 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
5cf1cf8 to
db1d76d
Compare
f19e87b to
3a993c4
Compare
3a993c4 to
700adae
Compare
|
Thank you, @qingminglong. This exact fix and regression coverage landed on I rechecked the current files: |
|
Thanks @qingminglong — this fix and its tests are preserved as the contributor-authored first commit in maintainer takeover #100399, which also carries the changelog credit and broader Testbox proof. Closing this source PR to avoid two competing branches landing the same cron parser change. #100306 remains open until #100399 actually merges; if that takeover is abandoned, this PR can be reopened. |
Closes #100306
What Problem This Solves
Fixes an issue where users setting cron CLI duration flags could have positive sub-millisecond values silently treated as
0mswhen the value was below one millisecond.Why This Change Was Made
The cron duration parser now rejects values whose millisecond result is non-finite or non-positive after unit conversion and flooring. This keeps the existing overflow guard while also rejecting tiny positive inputs that would otherwise become zero-duration metadata or cooldowns.
User Impact
Cron schedule and failure-alert duration inputs such as
0.5msare rejected instead of being accepted as an unintended zero-millisecond value.Evidence
ab50fb9f03580c368b93e11f26281719c8ebecc3.src/cli/cron-cli/shared.tssrc/cli/cron-cli/shared.test.tsgit diff --check-> passed after merging currentupstream/main(6237580e3cc40d1c05a832428feee048dd3feb44).ode scripts/run-vitest.mjs src/cli/cron-cli/shared.test.ts -> passed, 1 test file / 30 tests.
node scripts/run-vitest.mjs src/scripts/test-projects.test.ts-> passed, 1 test file / 83 tests; this covers the stalechecks-node-compact-small-whole-2log assertion after the branch merge.OPENCLAW_HOME,OPENCLAW_STATE_DIR, andOPENCLAW_CONFIG_PATH:node --import tsx src/entry.ts cron create --name subms-proof --every 0.5ms --system-event tick --json->Error: Invalid --every. Use a duration like 10m, 1h, or 1d., exit code 1.node --import tsx src/entry.ts cron edit proof-job --failure-alert --failure-alert-cooldown 0.5ms --failure-alert-mode announce->Error: Invalid --failure-alert-cooldown., exit code 1.python .agents\skills\autoreview\scripts\autoreview --mode local-> clean on the earlier local proof pass.Real behavior proof, workflow sanity, dependency guard, labeler, and OpenGrep have already reported success, with CI/CodeQL still in progress.0.5msfor both cron schedule creation and failure-alert cooldown before creating persistent user cron state.checks-node-compact-small-whole-2, failed insrc/scripts/test-projects.test.ts:857because helper routing receivedtest/scripts/package-git-fixture.test.ts. That failure is outside this PR's cron parser diff; this PR only changessrc/cli/cron-cli/shared.tsandsrc/cli/cron-cli/shared.test.ts.