Repository navigation
fix(cron): reject on-exit cwd on stream metadata edits - #198588
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. What this changesRejects --on-exit-cwd without --on-exit before stream metadata edits can bypass validation. Example: A stream job has cwd /old; run openclaw cron edit JOB_ID --stream-cwd /x --on-exit-cwd /y.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current CLI validation bug with a minimal change and no actionable findings. The new Gateway proof resolves the previous review’s concern; exact-head CI is still running. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe cron CLI normalizes schedule flags before constructing Gateway updates; invalid combinations produce CLI errors instead of job mutations. flowchart TD
A[CLI schedule flags] --> B[Shared schedule normalization]
B --> C[Invalid option error]
B --> D[Schedule edit resolution]
D --> E[Gateway cron update]
E --> F[Stored automation]
Technical reviewBest possible solution: Keep the requirement in shared schedule normalization so every creation and edit path validates it before constructing an update. Do we have a high-confidence way to reproduce the issue? Current-main source confirms the early-return bypass, and the collaborator’s real CLI/Gateway comparison records the failing input and repaired result; this review executed no target code. Is this the best way to solve the issue? This is the smallest complete fix: enforce the existing invariant once in the shared normalizer, remove redundant checks, and cover the bypass through the CLI registration. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 281c2bcd554b. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -1, Tests 0. Total -1 across 2 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. 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 HistoryReview history (1 earlier review cycle)
Reviewed November 13, 2026, 10:36 PM ET / November 14, 2026, 03:36 UTC (Revision 2). |
|
Proof at 5ba2528 (prod code unchanged from d541681; my commit only folds the new test into the existing edit-reject table, net test lines 0). Setup: secretless node:24.22.1 container. Built main (52e231b, no cron-cli changes on main since) and this PR with
The PR's stderr for the stream case is byte-identical to main's existing error for the plain on-exit case ( Tests: |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Landed in d98ec68. Thanks @Wang-Zephyr. |
fix(cron): reject --on-exit-cwd without --on-exit when editing a stream automation When editing a stream automation, the stream path returned early before the existing "--on-exit-cwd requires --on-exit." check, so openclaw cron edit <id> --stream-cwd /x --on-exit-cwd /y applied the stream change and silently dropped --on-exit-cwd. The check now runs on that path too, so the edit fails with the existing message before anything is sent and the job is unchanged. Other edits are unchanged. No new text. Evidence: the built CLI against a real gateway on an isolated profile in a secretless node:24.22.1 container, main twice and candidate twice. On main the edit exited 0, changed the stream working directory and dropped --on-exit-cwd. With this change it exits 1 with the existing error (byte-identical to main's message) and the job keeps its old working directory. --stream-cwd alone, --on-exit-cwd alone on an on-exit job, and a valid --on-exit with --on-exit-cwd behave the same on both. One row in the existing edit-reject table fails on main, at net 0 test lines. Details: openclaw#198588 (comment). Fixes openclaw#198587. Thanks @Wang-Zephyr. Co-authored-by: Ayaan Zaidi <[email protected]>
Fixes #198587
What Problem This Solves
A stream metadata edit can succeed while silently ignoring an incompatible --on-exit-cwd flag.
User Impact
The CLI reports the invalid flag combination before it updates the automation.
Why This Change Was Made
Validate the option pair during schedule normalization, before the stream metadata branch can return.
Evidence