Skip to content

fix(ui): reject nondecimal cron repeat amounts - #107480

Merged
steipete merged 10 commits into
openclaw:mainfrom
zhangguiping-xydt:fix/problem-control-ui-cron-decimal
Jul 16, 2026
Merged

steipete merged 10 commits into
openclaw:mainfrom
zhangguiping-xydt:fix/problem-control-ui-cron-decimal

Conversation

@zhangguiping-xydt

@zhangguiping-xydt zhangguiping-xydt commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where the Control UI accepted JavaScript numeric syntax such as 0x10, 1e3, or +1 in the recurring interval field. Those strings could be silently reinterpreted as a different interval, and the schedule preview described them as valid.

Why This Change Was Made

One parser now owns validation, request construction, and preview rendering. It accepts plain positive decimal syntax, converts the selected unit to milliseconds with exact integer arithmetic, and requires a safe integer result from 1 through Number.MAX_SAFE_INTEGER.

This keeps valid fractional intervals such as 1.5 or 4.1 minutes while rejecting exponent, hexadecimal, signed, fractional-millisecond, and overflow values. Gateway schemas and unrelated Cron numeric fields keep their existing contracts.

User Impact

Invalid repeat amounts show the existing invalid-interval error, produce no preview, and send no create or update request. Valid decimal inputs retain their existing behavior.

Evidence

Before the fix, the current main Control UI accepted 1e3 minutes and rendered Runs every 1e3 minutes.

Before: 1e3 accepted with a schedule preview

After the fix, 1e3 minutes shows the field error and no schedule summary.

After: 1e3 rejected as an invalid interval

Additional live proof:

  • 4.1 minutes remains valid and renders Runs every 4.1 minutes.
  • 1.5 minutes saves as exactly 90000 milliseconds.

Verification:

  • 106 focused controller and view tests passed on the current main merge.
  • Linux Node 24 production build passed in AWS Crabbox run run_1a0874dd377e.
  • Live Chrome before/after behavior proof passed.
  • Autoreview clean after exact-decimal edge cases were repaired.
  • Exact-head deadcode failure repaired by removing an unused type export.
  • git diff --check passed.
  • Exact-head hosted CI run 29492134087 passed all required jobs.

Changelog

Not added. CHANGELOG.md is release-owned; release-note context lives here.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. P2 Normal backlog priority with limited blast radius. labels Jul 14, 2026
@clawsweeper

clawsweeper Bot commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 16, 2026, 5:12 AM ET / 09:12 UTC.

Summary
The PR adds a cron-specific exact-decimal parser and uses it for recurring-interval validation, request construction, preview rendering, and regression tests.

PR surface: Source +33, Tests +89. Total +122 across 5 files.

Reproducibility: yes. Current-main behavior accepted inputs such as 1e3 for a recurring interval, and the recorded live before/after path verifies that the patched UI rejects them without previewing or submitting a schedule.

Review metrics: none identified.

Root-cause cluster
Relationship: canonical
Canonical: #107480
Summary: This PR is the narrower, proof-positive implementation for the cron interval defect; the related PR changes a shared numeric helper with a wider compatibility boundary.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Risk before merge

  • [P1] The branch is behind current main and several exact-head checks remain pending or unsuccessful, so the final merge head still needs the required checks to resolve.

Maintainer options:

  1. Decide the mitigation before merge
    Land the cron-owned exact parser after refreshing the merge head and completing required checks; avoid broadening the shared toNumber() contract, then reconcile the overlapping fix(ui): reject non-decimal input in toNumber() to prevent hex/scientific notation bypass #107905.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No automated repair is needed; refresh the exact merge head, let required checks finish, and complete normal maintainer review.

Security
Cleared: The patch is limited to local UI parsing and tests and introduces no dependency, workflow, permission, secret-handling, download, or supply-chain change.

Review details

Best possible solution:

Land the cron-owned exact parser after refreshing the merge head and completing required checks; avoid broadening the shared toNumber() contract, then reconcile the overlapping #107905.

Do we have a high-confidence way to reproduce the issue?

Yes. Current-main behavior accepted inputs such as 1e3 for a recurring interval, and the recorded live before/after path verifies that the patched UI rejects them without previewing or submitting a schedule.

Is this the best way to solve the issue?

Yes. Keeping strict interpretation local to the cron field is the narrowest maintainable fix because it aligns validation, preview, and persistence without changing unrelated callers of the shared numeric helper.

AGENTS.md: unclear because the file could not be read completely.

Codex review notes: model internal, reasoning high; reviewed against f0720a856d77.

Label changes

Label justifications:

  • P2: This fixes a bounded Control UI validation bug with limited blast radius and no core runtime outage.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Production-built live Chrome evidence shows the invalid input rejected after the fix while valid fractional intervals remain usable, and the real-behavior-proof check succeeded.
  • proof: sufficient: Contributor real behavior proof is sufficient. Production-built live Chrome evidence shows the invalid input rejected after the fix while valid fractional intervals remain usable, and the real-behavior-proof check succeeded.
Evidence reviewed

PR surface:

Source +33, Tests +89. Total +122 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 3 44 11 +33
Tests 2 89 0 +89
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 133 11 +122

What I checked:

  • Exact parser: The new parser accepts positive plain-decimal syntax, performs exact BigInt unit conversion, and rejects non-integral, non-positive, overflowing, or unsafe millisecond results. (ui/src/lib/cron/decimal.ts:1, ba5d10974ca0)
  • Single validation contract: Form validation and schedule construction both call parseCronEveryMs, preventing validation and saved values from interpreting input differently. (ui/src/lib/cron/index.ts:294, ba5d10974ca0)
  • Preview consistency: The schedule preview uses the same parser and disappears for values that cannot be saved as safe integer milliseconds. (ui/src/pages/cron/view.ts:1232, ba5d10974ca0)
  • Regression coverage: Controller tests cover rejected JavaScript numeric syntax, overflow, fractional milliseconds, and valid exact fractional conversions. (ui/src/lib/cron/index.test.ts:1489, ba5d10974ca0)
  • Visible behavior coverage: View tests verify that invalid recurring amounts no longer produce a schedule summary. (ui/src/pages/cron/view.test.ts:621, ba5d10974ca0)
  • Real behavior proof: The PR records production-built Chrome before/after validation, and the exact-head Real behavior proof check completed successfully. (ba5d10974ca0)

Likely related people:

  • steipete: Assigned the PR and authored its latest commit refining the cron interval implementation to exact decimal conversion. (role: reviewer and exact-validation follow-up; confidence: high; commits: ba5d10974ca0; files: ui/src/lib/cron/decimal.ts, ui/src/lib/cron/index.ts, ui/src/pages/cron/view.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • 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.
Review history (4 earlier review cycles)
  • reviewed 2026-07-14T16:19:37.804Z sha e8f8731 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-14T16:46:04.940Z sha e8f8731 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-14T17:11:43.717Z sha e8f8731 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-16T02:06:48.344Z sha 6693331 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jul 14, 2026
@steipete
steipete merged commit 0c067fb into openclaw:main Jul 16, 2026
102 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 17, 2026
* fix(ui): reject nondecimal cron repeat amounts

* fix(ui): satisfy cron LOC ratchet

* fix(ui): validate cron intervals exactly

Co-authored-by: xingzhou <[email protected]>

* chore(pr): stage cron UI proof

Co-authored-by: xingzhou <[email protected]>

* chore(pr): remove staged cron UI proof

Co-authored-by: xingzhou <[email protected]>

* fix(ui): remove unused cron type export

Co-authored-by: xingzhou <[email protected]>

---------

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
wanyongstar added a commit to wanyongstar/openclaw that referenced this pull request Aug 14, 2026
…s strict decimal

The cron form's staggerAmount, timeoutSeconds, failureAlertAfter, and
failureAlertCooldownSeconds inputs were parsed with the lenient toNumber()
helper, so free text like "0x10", "1e5", or "0b11" passed validation and
was persisted as silently coerced values (16, 100000, 3). Reuse the strict
decimal discipline already applied to everyAmount (openclaw#107480) via a new
parseCronDecimal helper so non-decimal input surfaces the existing field
errors and blocks submit; plain decimals such as "30" and "0.5" are
unchanged.
zooqueen pushed a commit to zooqueen/openclaw that referenced this pull request Sep 11, 2026
* fix(ui): reject nondecimal cron repeat amounts

* fix(ui): satisfy cron LOC ratchet

* fix(ui): validate cron intervals exactly

Co-authored-by: xingzhou <[email protected]>

* chore(pr): stage cron UI proof

Co-authored-by: xingzhou <[email protected]>

* chore(pr): remove staged cron UI proof

Co-authored-by: xingzhou <[email protected]>

* fix(ui): remove unused cron type export

Co-authored-by: xingzhou <[email protected]>

---------

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor 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.

2 participants