Skip to content

fix(cron): allow timeoutSeconds: 0 for no-timeout mode - #41275

Closed
JonathanJing wants to merge 4 commits into
openclaw:mainfrom
JonathanJing:fix/cron-no-timeout
Closed

JonathanJing wants to merge 4 commits into
openclaw:mainfrom
JonathanJing:fix/cron-no-timeout

Conversation

@JonathanJing

Copy link
Copy Markdown
Contributor

🐛 Problem

The cron job UI validation logic incorrectly rejects timeoutSeconds: 0, which should represent "no timeout" mode.

Current behavior:

if (timeout <= 0) {
  errors.timeoutSeconds = "cron.errors.timeoutInvalid";
}

This prevents users from setting timeoutSeconds = 0 to disable timeout entirely.

✅ Solution

Update validation to allow 0 as a valid value (meaning "no timeout"):

// 0 = no timeout, > 0 = timeout in seconds
if (timeout !== 0 && timeout <= 0) {
  errors.timeoutSeconds = "cron.errors.timeoutInvalid";
}

📁 Files Changed

  • ui/src/ui/controllers/cron.ts - Updated validateCronForm function

🧪 Testing

  • Create a cron job with timeoutSeconds: 0
  • Verify it saves without validation errors
  • Confirm the job runs without timeout restrictions

📊 Impact

  • User-facing: Users can now disable timeout for long-running cron jobs
  • Backward compatible: Existing jobs with timeoutSeconds > 0 are unaffected
  • Risk: Low - single line change, clear semantic intent

📝 Related

Closes #41272

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b3a0dab238

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread ui/src/ui/controllers/cron.ts Resolved
@greptile-apps

greptile-apps Bot commented Mar 9, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a validation bug in validateCronForm and buildCronPayload where timeoutSeconds: 0 (intended to mean "no timeout") was incorrectly rejected or silently dropped. The actual implementation — using Number() + Number.isFinite() — is more robust than the approach described in the PR description and correctly handles edge cases like NaN and Infinity.

Key changes:

  • validateCronForm: now accepts 0 as a valid timeout, rejecting only negative numbers and non-finite values
  • buildCronPayload: now explicitly sets payload.timeoutSeconds = 0 when the user enters "0", and defensively throws on invalid input (rather than silently skipping)
  • Note: The new code uses Number() directly, while the rest of the file uses the toNumber() utility from ../format.ts — a minor inconsistency worth harmonizing for readability

Confidence Score: 4/5

  • This PR is safe to merge — it's a minimal, well-scoped fix with correct logic and no regressions for existing positive-timeout jobs.
  • The fix correctly addresses the stated bug. The validation and payload-build logic are consistent with each other, backward compatibility is maintained, and the Number.isFinite() guard handles all edge cases (NaN, Infinity, negative numbers). The only deduction is a minor style inconsistency in using Number() directly instead of the existing toNumber() utility, and the assumption (not verifiable from the frontend alone) that the backend correctly interprets timeoutSeconds: 0 as "no timeout".
  • No files require special attention beyond ui/src/ui/controllers/cron.ts.

Comments Outside Diff (1)

  1. ui/src/ui/controllers/cron.ts, line 141 (link)

    Inconsistent use of Number() vs toNumber() utility

    The rest of the file (e.g. staggerAmount, everyAmount, failureAlertAfter, failureAlertCooldownSeconds) consistently uses the toNumber() helper from ../format.ts. This change switches to raw Number() for timeoutSeconds, which works correctly but introduces a stylistic inconsistency that could confuse future readers.

    Consider using the existing utility with a NaN fallback to keep the approach consistent:

    The same applies at line 580 in buildCronPayload.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Last reviewed commit: e497923

@JonathanJing

Copy link
Copy Markdown
Contributor Author

@greptile review

@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Apr 26, 2026
@clawsweeper

clawsweeper Bot commented Apr 27, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Keep open: the linked Control UI bug is still present on current main and the latest release, and this PR is the active focused fix candidate, but it still needs real behavior proof and maintainer acceptance of exposing the existing no-timeout sentinel through the UI.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #41272
Summary: This PR is the active fix candidate for the canonical Control UI zero-timeout issue; nearby CLI timeout parsing work is adjacent but distinct.

Members:

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

Canonical path: Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review.

So I’m closing this here because the remaining work is already tracked in the canonical issue.

Review details

Best possible solution:

Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review.

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

Yes by source inspection. Current main rejects timeoutSeconds: "0" in validateCronForm, drops explicit zero in buildCronPayload, and the adjacent controller test still expects the invalid-timeout error.

Is this the best way to solve the issue?

Yes, the patch shape is the right boundary because it updates both validation and payload preservation while rejecting malformed input; the remaining gap is proof and focused regression coverage, not a different implementation layer.

Security review:

Security review cleared: Security review cleared: the diff only changes Control UI TypeScript validation/payload parsing and adds no dependency, workflow, secret, package, install, or code-execution surface.

AGENTS.md: found and applied where relevant.

What I checked:

  • stale F-rated PR: PR was opened 2026-03-09T16:47:35Z, is older than 60 days, and the latest review rated it F.
  • proof blocker: real behavior proof is missing and proof tier is F, so this branch is not merge-ready without contributor follow-up.
  • no human follow-up: live comments and timeline hydrated by apply contain no non-automation activity after the ClawSweeper review.

Likely related people:

  • Takhoffman: The full cron edit parity commit made large Control UI cron controller, test, and view changes and carried the original positive-only timeout validation behavior. (role: feature-history owner; confidence: high; commits: 77c3b142a966; files: ui/src/ui/controllers/cron.ts, ui/src/ui/controllers/cron.test.ts, ui/src/ui/views/cron.ts)
  • steipete: The early Control UI dashboard expansion introduced the cron controller/view structure, and current blame in the shallow checkout routes the maintained file through the latest main commit. (role: introduced adjacent behavior and recent area contributor; confidence: medium; commits: 6ff837125475, d96db362bd96; files: ui/src/ui/controllers/cron.ts, ui/src/ui/views/cron.ts)
  • mbelinky: Recent command-job support changed the same cron controller, tests, and view around payload handling and validation boundaries after the original UI cron surface landed. (role: recent adjacent contributor; confidence: medium; commits: b8adc11977ab; files: ui/src/ui/controllers/cron.ts, ui/src/ui/controllers/cron.test.ts, ui/src/ui/views/cron.ts)

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

@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Apr 28, 2026
@clawsweeper clawsweeper Bot added the P2 Normal backlog priority with limited blast radius. label May 16, 2026
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label May 16, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels May 18, 2026
@clawsweeper

clawsweeper Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat.

Where did the egg go?
  • The egg game starts only after the PR passes the real-behavior proof check.
  • Before that, no creature or rarity is rolled. The treat waits for real proof.
  • This is still just collectible flavor: proof affects review readiness, not creature quality.

@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jun 5, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. label Jun 10, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Jun 11, 2026
@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels Jun 11, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. and removed merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Jun 13, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Jun 16, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added stale Marked as stale due to inactivity triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 1, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 2, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Jul 3, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. label Jul 4, 2026
@steipete

steipete commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Thanks for the contribution. I’m closing this stale PR because the latest review rated the current branch F: it still lacks the requested real-behavior proof or merge-ready branch shape, and there has been no human follow-up after the review. A fresh, focused PR against current main with the requested proof is welcome.

@steipete steipete closed this Jul 9, 2026
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 merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Cron job UI rejects timeoutSeconds: 0 (no-timeout mode)

2 participants