Repository navigation
fix(cron): reject blank automation working directories - #129714
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: blocked before merge. Reviewed September 18, 2026, 9:16 AM ET / 13:16 UTC (Revision 5). ClawSweeper reviewWhat this changesReject blank working-directory arguments when creating automations, preserve stream-directory clearing during edits, and document and test those behaviors. Merge readiness⛔ Blocked before merge - 1 item remains This remains useful: current main still accepts blank creation directories, and the merged edit fix does not cover creation. No actionable patch defects were found. The PR body explicitly accepts the compatibility tradeoff raised in the previous review. Priority: P2 Review scores
Verification
How this fits togetherThe automation CLI turns command-line arguments into Gateway requests that create scheduled jobs. This change rejects invalid directory arguments before a request can create a job using an unintended default directory. flowchart TD
A[Automation add or create] --> B[Check supplied directories]
B -->|Blank| C[Local CLI error]
B -->|Omitted or valid| D[Build schedule and payload]
D --> E[Gateway creates automation]
F[Automation edit] --> G[Existing directory clearing behavior]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +9, Tests +162, Docs +5. Total +176 across 3 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep validation at the creation boundary, honoring the accepted compatibility decision while preserving omitted defaults and stream-edit clearing. Do we have a high-confidence way to reproduce the issue? Yes, from source: current-main creation normalizes explicit blank cwd arguments into omitted directories. Registered-command regression cases cover the path, but this review did not run them. Is this the best way to solve the issue? Yes. A creation-only guard reuses existing normalization and error handling without changing the shared edit contract; the intentional compatibility change is documented and accepted. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e14de8fe613e. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
Validate explicitly supplied command, on-exit, and stream directories before creating an automation. Preserve omitted defaults, valid paths, and intentional blank stream-directory edits.
99e0c9a to
b2b130c
Compare
|
Merged via squash.
|
Validate explicitly supplied command, on-exit, and stream directories before creating an automation. Preserve omitted defaults, valid paths, and intentional blank stream-directory edits.
What Problem This Solves
Fixes automation creation accepting an explicitly empty or whitespace-only working directory and silently using the default directory.
User Impact
addandcreatereject blank--command-cwd,--on-exit-cwd, and--stream-cwdvalues before any Gateway request. Omitted and valid paths keep their existing behavior, and blank stream-directory edits still clear the configured directory. Errors retain the current human and JSON formats.Why This Change Was Made
A small validation step belongs at the existing creation boundary. It uses
CronCliErrorand the shared string normalizer while leaving edit normalization and numeric/zero-timeout handling intact. The CLI docs now explain creation rejection and stream-edit clearing.Compatibility decision: accepting explicitly blank creation paths as errors is intentional. Scripts that expand an unset variable into one of these flags must omit the flag to use the default directory. The prevalence of scripts relying on the former silent coercion is unknown; that tradeoff is accepted to prevent creating an automation in an unintended directory. Existing automations and blank stream-directory edits keep their behavior.
Evidence
The registered-Commander baseline produced 17 intended blank-input failures while 49 controls and existing cases passed. After the repair, all 589 focused tests across eight files passed, covering creation flags, omitted/valid paths, both aliases, positional schedules, JSON error classification, edit clearing, scheduling, and numeric validation. Independent P2 review found no actionable issues. The tests use a mocked Gateway transport; no live automation was created. The final options file also passed all 66 cases. Final selected checks passed against the pinned base, including core and test typechecking, lint, formatting, and repository guards.
git diff --checkpassed.