Repository navigation
fix(cron): preserve literal script file paths - #145673
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 12, 2026, 2:05 AM ET / 06:05 UTC. ClawSweeper reviewWhat this changesPreserves literal script filenames when adding or editing automations, with regression coverage and documentation for paths containing surrounding spaces. Merge readiness✅ Ready for maintainer review This remains a useful, focused fix: current main still trims script filenames, and the reviewed patch has no actionable correctness findings. Maintainer authorship and the protected label also preclude cleanup closure. Priority: P2 Review scores
Verification
How this fits togetherThe automation CLI reads local payload and condition scripts before sending their contents to the Gateway. Filename handling determines which script becomes part of the automation. flowchart LR
A[Quoted CLI argument] --> B[Validate nonblank filename]
B --> C{Exact stdin sentinel?}
C -->|Yes| D[Read stdin]
C -->|No| E[Read named file]
D --> F[Validate script content and size]
E --> F
F --> G[Send automation create or update]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -4, Tests +15, Docs 0. Total +11 across 7 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep filename validation at the CLI producers while the shared reader continues to own exact file access, stdin selection, and script validation. Do we have a high-confidence way to reproduce the issue? Yes. Current main trims a quoted trailing-space filename before opening it, so two neighboring files with distinct contents establish a deterministic wrong-file path; this review did not execute it. Is this the best way to solve the issue? Yes. Reusing the existing nonblank reader repairs all four argument producers without adding another parser, changing stored data, or duplicating script-loading policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5de618a09b7b. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
Fixes an issue where
cron addandcron editsilently read a different script when a quoted filename contains leading or trailing whitespace. For example, passing"payload.js "selectedpayload.jsif that neighboring file existed, then reported success.Why This Change Was Made
All four payload/trigger file-argument producers now use the existing nonblank string reader, which preserves the original filename. The shared stream reader continues to own the exact
-stdin sentinel, byte limits, content trimming and read errors.The add path reads the script in its original payload branch, removing its intermediate script-path representation and second conversion step. Formatted production is 13 lines added / 17 removed, net −4. Tests are +53/−38 and docs +2/−2. No parser, option, compatibility path or execution policy is added.
User Impact
The CLI sends the contents of the named local file. Payload budgets, trigger
once, edit revision handling, ordinary filenames, blank-input validation and existing output/exit behavior remain intact. The docs clarify literal file-path handling.Evidence
pnpm build ciArtifactspassed in 109.8 seconds; the compiled registrar and all four repaired producer sites were inspected. Fresh managed P0–P2 review found no actionable defects.The CLI proof uses Node 24.20.0 with the existing launcher-equivalent experimental-warning flag and disabled compile cache. It exercises the normal final runtime on macOS. Generated outputs and named source/ws/Commander files are sealed with qualified frozen-install evidence; this is not a fully hermetic external/native dependency claim. The receiver only records input and returns an acknowledgment: Gateway persistence, scheduler/script execution and channel delivery are outside these observations.
Independent source, current-main compatibility and raw/compiled before/after audits found no blocking discrepancy. This is one shared cron argument-producer defect across four call sites. Current reviewed head:
a7df240e7871b0894018c8f73182e1b374ca9892; its full-index patch is byte-identical to the tested/reviewed precommit source. Hosted CI remains required before native landing.