Repository navigation
fix(cron): reject blank script paths before mutations - #148787
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: needs maintainer review before merge. Reviewed September 15, 2026, 3:31 AM ET / 07:31 UTC (Revision 2). ClawSweeper reviewWhat this changesReject empty or whitespace-only script paths in automation add and edit commands before Gateway access, with command-level regression coverage. Merge readiness✅ Ready for maintainer review This PR remains necessary: current main still silently ignores explicit blank script paths. The focused repair has relevant real Gateway observations and no actionable correctness findings. Priority: P2 Review scores
Verification
How this fits togetherThe automation CLI converts command arguments and local script files into Gateway requests that create or update scheduled jobs. Local validation prevents invalid input from partially changing those jobs. flowchart TD
A[Automation command arguments] --> B[CLI input validation]
B --> C{Explicit blank script path?}
C -->|Yes| D[Error with no Gateway request]
C -->|No| E[Prepare job payload or patch]
E --> F[Gateway automation service]
F --> G[Saved scheduled job]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +6, Tests +20. Total +26 across 4 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep blank-path rejection in the existing CLI handlers while preserving omitted scripts, stdin, literal filenames, and Gateway-owned job persistence. Do we have a high-confidence way to reproduce the issue? Yes: current source shows that an explicit blank script becomes absent while unrelated edits can proceed, matching the supplied isolated Gateway observations; this reviewer did not execute it. Is this the best way to solve the issue? Yes: the guards repair argument acceptance before Gateway access, reuse existing normalization, and preserve the established literal-path behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5a826aa18d3d. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
landpr-approve-admin-merge |
|
Thanks @Alix-007! Proof: Empty and whitespace-only script arguments fail before any Gateway connection and leave saved jobs unchanged. Valid filenames, stdin, and metadata-only edits still work.
|
* commit '0945dabbe487213e95e84a72ad1aae3659e0e000': (115 commits) fix: omit automation service aliases from squash coauthors (#148883) test: restore services typecheck shard headroom (#148885) perf(trajectory): avoid native probes for truncation records (#148870) improve(gateway): load cron only when reload requests it (#143500) fix: resolve issue #146088 — [Bug]: The most recent Linux AppImage does not ship with the correct versions of libs needed to run (#148174) refactor(theme): share nonvirtual ANSI color lookup (#148717) perf(gateway): scope exact session row topology reads (#148836) improve(memory): reduce vector replacement overhead (#148201) fix(i18n): keep HTTP headers out of native translations (#147119) refactor(plugins): share source-root display formatting (#148646) fix(cron): reject blank script paths before mutations (#148787) refactor(config): share audit positional scanning (#148643) fix(test): restore infrastructure typecheck shard headroom (#148861) fix(release): harden package validation fallbacks (#148729) refactor(config): share leaf and descendant unset pruning (#148216) test: reuse prepared runtime for pristine preflight (#148858) fix(ui): settle global model drafts across agent switches (#148843) fix(queue): avoid repeated scans when cancelling backlogs (#148754) fix(logging): orphaned \\\\?\\ path markers corrupt redacted Windows diagnostics (#147542) refactor(hooks): share optional reply metadata projection (#148641) ...
## What Problem This Solves An empty `$SCRIPT_FILE` silently drops a requested script replacement while other job edits succeed. Add can likewise accept another payload and ignore the blank script. ## Why This Change Was Made The existing add/edit validation owns script-argument acceptance. Each handler gains three lines to reject explicit blanks before any Gateway request. This state has one writer: the existing Gateway cron service. Growth accepted under the owner's standing acceptance (2026-09-15). ## User Impact Invalid input reports `--script must not be blank`. Omitted scripts and exact nonblank filenames remain valid. ## Evidence On a disabled job in an isolated Gateway: `SCRIPT_FILE=""; openclaw cron edit "$JOB" --script "$SCRIPT_FILE" --display-name Replacement` Main exits 0, changes the label, and retains the old script. The fix exits 1 with the diagnostic, zero connections, and unchanged job readback. Whitespace and blank-plus-message add cases show the same repair. Omitted-script edits, spaced filenames with a distinct trimmed decoy, stdin, and empty/missing files passed. Local static checks passed. Persistence was checked after stopping the actual Gateway process, confirming that its children exited and its port closed, then starting a new Gateway. The new listener belonged to the new launcher and had the intended database open before the saved-job readback. The job was unchanged across that restart. Main-created state was also reopened with the candidate. The earlier restart observations were excluded because they reached the original process. The four CLI suites passed all 421 tests on merge commit `84bdc1b42e01d13434a531edb25dc809e2ee7399`, with parents `63f2d06f1178aa41aefabf679049c0dd86280871` and `23a4c20ecd38eb72af26d7327cb54a86e44ae65c`. The tests add four registered-command cases and retain every existing assertion. Scheduled execution and delivery were not exercised. ## Compatibility No new options, schema, migration, or execution changes. Scheduled execution and delivery were not exercised. ## Consumers `cron`/`automations` add/create and edit share the repaired registration. ## Invalidation No cache or stored-state change. ## Tests Four new command regressions; existing sibling controls retained. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
An empty
$SCRIPT_FILEsilently drops a requested script replacement while other job edits succeed. Add can likewise accept another payload and ignore the blank script.Why This Change Was Made
The existing add/edit validation owns script-argument acceptance. Each handler gains three lines to reject explicit blanks before any Gateway request. This state has one writer: the existing Gateway cron service.
Growth accepted under the owner's standing acceptance (2026-09-15).
User Impact
Invalid input reports
--script must not be blank. Omitted scripts and exact nonblank filenames remain valid.Evidence
On a disabled job in an isolated Gateway:
SCRIPT_FILE=""; openclaw cron edit "$JOB" --script "$SCRIPT_FILE" --display-name ReplacementMain exits 0, changes the label, and retains the old script. The fix exits 1 with the diagnostic, zero connections, and unchanged job readback. Whitespace and blank-plus-message add cases show the same repair.
Omitted-script edits, spaced filenames with a distinct trimmed decoy, stdin, and empty/missing files passed. Local static checks passed.
Persistence was checked after stopping the actual Gateway process, confirming that its children exited and its port closed, then starting a new Gateway. The new listener belonged to the new launcher and had the intended database open before the saved-job readback. The job was unchanged across that restart. Main-created state was also reopened with the candidate. The earlier restart observations were excluded because they reached the original process.
The four CLI suites passed all 421 tests on merge commit
84bdc1b42e01d13434a531edb25dc809e2ee7399, with parents63f2d06f1178aa41aefabf679049c0dd86280871andaa688090a4cddbca64abe8bad3b8f778cca8eb4d. The tests add four registered-command cases and retain every existing assertion. Scheduled execution and delivery were not exercised.Compatibility
No new options, schema, migration, or execution changes. Scheduled execution and delivery were not exercised.
Consumers
cron/automationsadd/create and edit share the repaired registration.Invalidation
No cache or stored-state change.
Tests
Four new command regressions; existing sibling controls retained.