Fix/cron parse undefined#72449
Conversation
The parseAbsoluteTimeMs function would throw 'Cannot read properties of undefined (reading trim)' when called with undefined or null input. This could happen when cron jobs had malformed or missing schedule data. Fixes openclaw#69547
The openclaw update command would run a full npm install even when the installed version already matched the latest registry version. This caused unnecessary work, wasted time, and could be dangerous on resource-constrained systems. This fix adds a version comparison before invoking the package manager. If the current version equals the target version (and no explicit tag was requested), the update is skipped with an informative message. Fixes openclaw#69412
Greptile SummaryThis PR fixes a crash in Confidence Score: 4/5Safe to merge; the cron parse fix is correct and well-tested, and the update-command change is low-risk with one minor labelling issue. Only a P2 style issue was found (hardcoded src/cli/update-cli/update-command.ts — verify the channel-label messaging. Prompt To Fix All With AIThis is a comment left during a code review.
Path: src/cli/update-cli/update-command.ts
Line: 1348
Comment:
**Hardcoded `(latest)` label may be misleading**
The message `Already on ${currentVersion} (latest). Nothing to update.` is shown whenever `currentVersion === targetVersion && !explicitTag`, regardless of which channel the user is tracking. If the user is on a `beta` or `next` channel, the resolved `targetVersion` could be a pre-release that is not "latest" in the npm `latest` tag sense, making the message confusing.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "Merge branch 'openclaw:main' into fix/cr..." | Re-trigger Greptile |
| !explicitTag | ||
| ) { | ||
| if (!opts.json) { | ||
| defaultRuntime.log(theme.success(`Already on ${currentVersion} (latest). Nothing to update.`)); |
There was a problem hiding this comment.
Hardcoded
(latest) label may be misleading
The message Already on ${currentVersion} (latest). Nothing to update. is shown whenever currentVersion === targetVersion && !explicitTag, regardless of which channel the user is tracking. If the user is on a beta or next channel, the resolved targetVersion could be a pre-release that is not "latest" in the npm latest tag sense, making the message confusing.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/cli/update-cli/update-command.ts
Line: 1348
Comment:
**Hardcoded `(latest)` label may be misleading**
The message `Already on ${currentVersion} (latest). Nothing to update.` is shown whenever `currentVersion === targetVersion && !explicitTag`, regardless of which channel the user is tracking. If the user is on a `beta` or `next` channel, the resolved `targetVersion` could be a pre-release that is not "latest" in the npm `latest` tag sense, making the message confusing.
How can I resolve this? If you propose a fix, please make it concise.|
Thanks for the contribution. I reviewed the branch, and this PR is not a good landing base for OpenClaw. Close: this branch is not a safe landing candidate because it mixes a small cron parser guard with an unrelated update early-exit that conflicts with current main's same-version package refresh contract, has no real behavior proof, and is currently conflicting. So I’m closing this PR rather than keeping an unmergeable branch open. A new narrow PR that carries only the useful part is welcome. Review detailsBest possible solution: Close this mixed branch, keep current main's package-refresh semantics, and accept a new narrow cron-only PR only if it includes a current stack trace or real repro for nullish parser input. Do we have a high-confidence way to reproduce the issue? Unclear for the claimed cron crash: the linked report was closed as a docs-link path and current cron call sites guard Is this the best way to solve the issue? No. The maintainable path is a narrow cron-only change with current proof, while preserving the current package-update refresh contract. Security review: Security review cleared: The diff changes CLI update control flow but adds no dependencies, workflow changes, secret handling, network sources, or new supply-chain execution surface beyond the functional update-path regression. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 20534c57b7e8. |
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
|
This pull request has been automatically marked as stale due to inactivity. |
|
ClawSweeper applied the proposed close for this PR.
|
Summary
Describe the problem and fix in 2–5 bullets:
If this PR fixes a plugin beta-release blocker, title it
fix(<plugin-id>): beta blocker - <summary>and link the matchingBeta blocker: <plugin-name> - <summary>issue labeledbeta-blocker. Contributors cannot label PRs, so the title is the PR-side signal for maintainers and automation.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
For bug fixes or regressions, explain why this happened, not just what changed. Otherwise write
N/A. If the cause is unclear, writeUnknown.Regression Test Plan (if applicable)
For bug fixes or regressions, name the smallest reliable test coverage that should catch this. Otherwise write
N/A.User-visible / Behavior Changes
List user-visible changes (including defaults/config).
If none, write
None.Diagram (if applicable)
For UI changes or non-trivial logic flows, include a small ASCII diagram reviewers can scan quickly. Otherwise write
N/A.Security Impact (required)
Yes/No)Yes/No)Yes/No)Yes/No)Yes/No)Yes, explain risk + mitigation:Repro + Verification
Environment
Steps
Expected
Actual
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
Review Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Yes/No)Yes/No)Yes/No)Risks and Mitigations
List only real risks for this PR. Add/remove entries as needed. If none, write
None.