Repository navigation
refactor(ui): reuse JSON validation for cron event arguments - #177473
Conversation
|
🦞👀 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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis PR replaces local cron event-argument parsing and exception handling with the shared safeParseJsonRecord helper. Example: Enter event arguments in the Automation editor.
Review scores
ProductKind: Refactor · Worth it: Yes Merge readiness✅ Ready for maintainer review This PR makes a focused, behavior-preserving simplification using the existing JSON parser; no actionable correctness or security defect was found. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Control UI validates Automation form values before building a schedule and sending a Gateway mutation; this change affects only JSON-object validation. flowchart LR
A[Automation editor] --> B[Cron form validation]
B --> C[Shared JSON record parser]
C --> D[Field errors]
B --> E[Schedule builder]
E --> F[Gateway mutation]
Technical reviewBest possible solution: Reuse the existing JSON-record parser while preserving the Automation form’s validation contract. Do we have a high-confidence way to reproduce the issue? This is a refactor without a reported behavioral bug; source inspection establishes equivalent validation, and no target code was executed. Is this the best way to solve the issue? The change is the smallest complete simplification: it removes duplicated parsing mechanics without adding state, wrappers, or alternate policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ac6c8b97ea83. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -3. Total -3 across 1 file. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 19, 2026, 12:34 PM ET / 16:34 UTC. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
What Problem This Solves
Cron event-argument validation duplicated the shared JSON parser's invalid-input handling.
User Impact
No user-visible change. JSON objects remain valid; malformed JSON, arrays, null, and primitive values retain the existing field error.
Why This Change Was Made
Use the existing
safeParseJsonRecordowner through its focused package subpath. This removes a local parse/catch branch without changing the cron editor, mutation lifecycle, lazy boundaries, or rendering. The schedule comparator keeps its catch because it also contains deep value comparison.Evidence
pnpm tsgo:uipnpm test ui/src/pages/cron/event-source.test.ts --maxWorkers=1git diff --checkpnpm deadcode:knip(production)Touched production LOC: 645 → 642 (−3). Tests: unchanged. Solid refactor checklist: controllers, effects, render effects, untrack, listeners, DOM queries, class-string composition, flush, and owner escapes all 0 → 0 in the touched module. This is a plain TypeScript refactor; no screenshot or local UI rebuild is needed under the lane's compute budget. No dependency or boot import boundary changes.
CI run
39284651423reports an inherited mock-export ratchet failure:src/infra/openclaw-process-census.missing-command.test.ts:12: ./container-environment.js. The exact diagnostic reproduces against the complete base tree8b78b230a1c109fe6456964e59cb0eeefe63b7e5using an isolated Git index andpnpm check:test-mock-exports --staged --base 8b78b230a1c109fe6456964e59cb0eeefe63b7e5 --no-merge-base. CI tested merge831cac23d6c412a357e062f41a17adfc55d610a3has that base and this PR head as its ordered parents. The changed-file line cap and all other reported ratchet subchecks passed. The native inherited-failure route will verify complete CI/security state before landing; this does not relabel the failed check as green.