Repository navigation
fix(cron): reject explicitly blank stagger values - #198596
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesReject explicitly empty or whitespace-only --stagger arguments before creating or updating a cron job. Example: Edit a job storing cron expression 0 * * * * and staggerMs 30000 with --cron '10 * * * *' --stagger ' '.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a distinct current-main bug with a minimal shared-parser change and no actionable findings; exact-head CI is still running. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherCommander passes add/edit options into the shared schedule resolver, which validates them before the CLI sends job mutations to the Gateway. flowchart LR
A[CLI arguments] --> B[Commander add or edit]
B --> C[Shared schedule resolver]
C --> D[Invalid input error]
C --> E[Gateway cron mutation]
E --> F[Stored job schedule]
Technical reviewBest possible solution: Keep the focused supplied-versus-omitted check in the existing shared schedule resolver. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the failure path, and the supplied real CLI/Gateway comparison records the mutation before the fix and rejection afterward; this review ran no target code. Is this the best way to solve the issue? The change fixes the input boundary shared by add and edit, preserves omission and valid durations, and adds no competing parser or state. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 94cc426fb0b4. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +3, Tests -5. Total -2 across 2 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReviewed November 13, 2026, 11:33 PM ET / November 14, 2026, 04:33 UTC (Revision 3). |
|
@clawsweeper re-review Added built CLI evidence against an isolated real Gateway to the PR body. The baseline behavior exits 0 and mutates the stored schedule. At |
|
🦞👀 Re-review progress:
|
|
Proof for head 4361fd7: built The blank-stagger error on the PR matches main's existing out-of-range error byte for byte ( Main is Thanks @Wang-Zephyr for the fix and the report in #198594. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Landed in 009fcd9. Thanks @Wang-Zephyr. |
fix(cron): reject a blank --stagger instead of dropping the saved stagger openclaw cron edit treated a blank --stagger value as if the option had been left out, so an edit such as --cron '10 * * * *' --stagger ' ' succeeded and silently dropped the job's saved stagger. A blank --stagger now raises the existing "Invalid --stagger" error before anything is sent, and the job is unchanged. Valid staggers, edits without --stagger and out-of-range staggers behave as before. No new text. Evidence: the built CLI against a real isolated gateway run in a secretless node:24.22.1 container, main once and candidate once. On main the edit exited 0, changed the schedule and removed the 30000 ms stagger. With this change it exits 1 with "Invalid --stagger; use e.g. 30s, 1m, 5m" (byte-identical to main's existing error) and the job keeps its schedule and stagger. --stagger 45s, an edit without --stagger and an out-of-range stagger behave the same on both. The blank case is a row in the existing invalid-stagger table and fails on main, at -5 net test lines. Details: openclaw#198596 (comment). Fixes openclaw#198594. Thanks @Wang-Zephyr. Co-authored-by: Ayaan Zaidi <[email protected]>
Fixes #198594
What Problem This Solves
cron editsilently accepts a whitespace-only--staggerand applies the schedule edit, dropping the existing explicit stagger.Why This Change Was Made
Distinguish a blank argument from an omitted flag in the shared add/edit schedule parser so the invalid request is rejected before it can mutate the job.
Evidence
Ran the built
openclaw.mjsfrom897c35fb2439on Windows with Node 24.22.1 against a realgateway runon loopback. Each lane used fresh state, no provider credentials, and a disabled cron job with0 * * * *and--stagger 30s. For the baseline control, temporarily removed just the new guard from the built CLI chunk to restore the52e231b703f7edit behavior. The Gateway and remaining CLI code were identical in both lanes.10 * * * *Invalid --stagger; use e.g. 30s, 1m, 5m0 * * * *The valid control,
cron edit JOB_ID --cron '20 * * * *' --stagger 45s, exited 0 and stored20 * * * *and45000in both lanes. Values were read back through the CLI after each edit.The Commander regression also fails on the original parser and passes on the PR. The trigger, positional, and on-exit files passed locally (126 focused tests), along with targeted formatting and lint. Standalone autoreview was unavailable.
OpenAI Codex assisted with the fix and verification.
Maintainer e2e proof (built CLI + isolated Gateway): #198596 (comment)