Repository navigation
fix(cron): reject blank schedule values before applying edits - #148271
Conversation
Reject blank primary schedule operands before creating or updating jobs. Preserve omitted schedule edits and optional stream metadata clearing, and remove the duplicate unreachable creation fallback. Production LOC remains neutral.
|
🦞👀 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. Reviewed September 14, 2026, 10:00 AM ET / 14:00 UTC. ClawSweeper reviewWhat this changesReject explicitly blank cron schedule flags before creating or updating jobs, preserve schedule-free edits, and add command-level regression coverage. Merge readiness✅ Ready for maintainer review The fix remains useful: fetched main and v2026.9.4 still collapse blank schedule operands into omission. The patch addresses that behavior without a blocking correctness finding; maintainer protection also precludes automatic closure. Priority: P2 Review scores
Verification
How this fits togetherThe cron CLI translates scheduling commands into Gateway requests that create or update automation jobs. Its shared schedule resolver validates inputs before mutation requests are sent. flowchart TD
A[Add or edit command] --> B[Shared schedule resolver]
B --> C{Explicit blank selector?}
C -->|Yes| D[Report input error]
C -->|No| E[Build schedule or metadata patch]
E --> F[Gateway mutation request]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource 0, Tests +110. Total +110 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep blank-versus-omitted validation in the shared schedule resolver while preserving valid schedules and optional metadata clearing. Do we have a high-confidence way to reproduce the issue? Yes, by source inspection: an edit combining --every "" with --name reaches a metadata update on fetched main because the blank selector becomes omission. Runtime reproduction was not executed in this read-only review. Is this the best way to solve the issue? Yes. The shared resolver covers all affected command entry points, and the guard leaves omission and optional stream metadata semantics intact. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 36a725a599bc. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
Reject blank primary schedule operands before creating or updating jobs. Preserve omitted schedule edits and optional stream metadata clearing, and remove the duplicate unreachable creation fallback. Production LOC remains neutral.
What Problem This Solves
An explicitly blank cron schedule can be silently ignored:
openclaw cron edit job-1 --every "" --name Renamedcan rename the job without applying the requested schedule change. Creation can likewise accept a valid schedule alongside a blank selector.User Impact
Empty or whitespace-only
--at,--every,--cron, and--on-exitoperands now fail before mutation. Omitting the schedule still permits metadata-only edits. Valid schedules and optional stream cwd/match clearing retain their existing behavior.Why This Change Was Made
The shared schedule resolver now distinguishes a supplied blank value from omission across add, create, and edit. It removes a duplicate, unreachable creation fallback using the existing invariant helper. Production changes are +8/-8, net zero after formatting; tests add 110 lines.
A pacing edit may read the existing job before validation, but cannot update it with an invalid schedule. Timezone and staggering behavior are unchanged.
Evidence
The baseline produced 14 intended failures and 20 passing controls. The repaired candidate passed 34 owner tests and 486 sibling tests. Those passes preceded two wrapping-only formatting changes; the complete changed gate and normal build then passed on the final formatted source. The initial formatting failure remains recorded.
The ordinary built CLI covered 21 cases per phase. All 14 defective cases now reject, and all seven controls preserve their outcomes. The candidate emitted 14 RPCs versus 42 before the fix; the invalid pacing case emitted only
cron.get. This input-only loopback RPC proof verifies CLI output and mutation requests, not live Gateway persistence or scheduled payload execution.All six independent P2 review passes returned no findings. The publication refresh preserves the exact reviewed patch and both file postimages; source inspection found no relevant validation dependency change. CI run 34850285924 passed for publication head
9bead6338a5bf5d1d998dc8587374ab83ef24a2c. ClawSweeper also reported no findings and no pre-merge work.