Skip to content

fix(cron): reject blank schedule values before applying edits - #148271

Merged
steipete merged 1 commit into
mainfrom
codex/qa-cron-blank-ac3
Sep 14, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/qa-cron-blank-ac3

Conversation

@steipete

@steipete steipete commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

An explicitly blank cron schedule can be silently ignored: openclaw cron edit job-1 --every "" --name Renamed can 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-exit operands 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.

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.
@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review September 14, 2026 13:36
@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: S maintainer Maintainer-authored PR labels Sep 14, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 14, 2026
@clawsweeper

clawsweeper Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 14, 2026, 10:00 AM ET / 14:00 UTC.

ClawSweeper review

What this changes

Reject 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
Reviewed head: 9bead6338a5bf5d1d998dc8587374ab83ef24a2c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused shared-owner repair with meaningful command-boundary regressions and no identified blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate; its body reports built-CLI loopback coverage of the changed resolver and mutation boundary, without claiming persistence or scheduled-execution proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate; its body reports built-CLI loopback coverage of the changed resolver and mutation boundary, without claiming persistence or scheduled-execution proof.
Evidence reviewed 7 items Introduced patch verified: The merge-base-to-head diff matches the supplied production hunks: four primary schedule operands are checked before normalization, and the unreachable creation fallback uses the existing invariant helper.
Mutation boundary: Creation resolves the schedule before constructing its mutation; editing resolves it before cron.update. Pacing edits can perform an earlier read, but the thrown validation error prevents the update.
Current-main behavior: Fetched main lacks the blank-operand guard and normalizes empty primary selectors into omission, leaving the reported partial-edit mechanism present.
Findings None None.
Security None None.

How this fits together

The 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source 0, Tests +110. Total +110 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 8 8 0
Tests 1 110 0 +110
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 118 8 +110

Review metrics

None.

Technical review

Best 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.

Labels

Label changes:

  • add P2: This fixes a bounded CLI validation defect that can silently apply only part of an automation edit.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate; its body reports built-CLI loopback coverage of the changed resolver and mutation boundary, without claiming persistence or scheduled-execution proof.

Label justifications:

  • P2: This fixes a bounded CLI validation defect that can silently apply only part of an automation edit.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate; its body reports built-CLI loopback coverage of the changed resolver and mutation boundary, without claiming persistence or scheduled-execution proof.

Evidence

What I checked:

  • Introduced patch verified: The merge-base-to-head diff matches the supplied production hunks: four primary schedule operands are checked before normalization, and the unreachable creation fallback uses the existing invariant helper. (src/cli/cron-cli/schedule-options.ts:205, 9bead6338a5b)
  • Mutation boundary: Creation resolves the schedule before constructing its mutation; editing resolves it before cron.update. Pacing edits can perform an earlier read, but the thrown validation error prevents the update. (src/cli/cron-cli/register.cron-edit.ts:315, 9bead6338a5b)
  • Current-main behavior: Fetched main lacks the blank-operand guard and normalizes empty primary selectors into omission, leaving the reported partial-edit mechanism present. (src/cli/cron-cli/schedule-options.ts:212, 36a725a599bc)
  • Latest-release check: The v2026.9.4 resolver also lacks this guard; the supplied latest release does not contain the proposed repair. (src/cli/cron-cli/schedule-options.ts:212, 3a9d69db306c)
  • Regression coverage: The added tests exercise registered add/create/edit commands, reject empty and whitespace operands, prevent mutation after a pacing read, and preserve a name-only edit when the schedule is omitted. Existing stream tests cover metadata preservation. (src/cli/cron-cli/register.cron-options.test.ts:60, 9bead6338a5b)
  • Captured proof scope: The supplied PR body, captured under sourceRevision 918b1a678b943eadf87a4c9dfea1b944cb256901886bebc06e47e9d9a83da63a, reports built-CLI loopback runs covering 21 cases per phase: 14 defective inputs reject after the fix and seven controls retain their outcomes. It explicitly limits this evidence to CLI output and RPC requests, excluding Gateway persistence and scheduled execution. This review did not execute those runs. (9bead6338a5b)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peik S.: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 859c0de into main Sep 14, 2026
178 checks passed
@steipete
steipete deleted the codex/qa-cron-blank-ac3 branch September 14, 2026 14:17
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 15, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant