Repository navigation
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. What this changesReport an actionable error when worktree creation receives a nonexistent source checkout path. Example: Run
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains This PR fixes a current diagnostic bug with a focused patch and convincing CLI proof; no actionable code findings remain, but current-head CI awaits workflow approval. Priority: P3 Before merge
FindingsNone. Agent review detailsHow this fits togetherThe worktree CLI resolves the supplied checkout before dispatching creation through the local state owner; expected input errors reach the shared human and JSON failure renderers. flowchart TD
A[Worktrees create command] --> B[Resolve source checkout]
B --> C[Expected CLI error]
C --> D[Human or JSON failure output]
B --> E[Local state owner]
E --> F[Managed worktree service]
Technical reviewBest possible solution: Merge the focused error translation once approved current-head workflows satisfy the existing CI gate. Do we have a high-confidence way to reproduce the issue? Current-main source exposes the raw missing-path exception before admission, and the contributor supplies matching built-CLI before/after output; no target code was executed during this read-only review. Is this the best way to solve the issue? The patch fixes classification at the CLI producer using the existing expected-error owner, preserves native path semantics and unrelated errors, and adds a useful boundary regression without unnecessary machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 97dd78cc2cbd. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +14, Tests +18. Total +32 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 HistoryReviewed November 15, 2026, 12:33 PM ET / 17:33 UTC (Revision 3). |
…tion Use hasErrnoCode instead of casting the caught error to NodeJS.ErrnoException, so the assertion-safety ratchet has no new uncommented assertion to flag.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Thanks for the work here. We're closing this along with the author's other open PRs: the series splits one kind of change across many commands or call sites, and much of it is backed only by issues filed by the same author. Please open one issue per root cause with a reproduction from a real affected setup; maintainers will decide scope and fix it once at the shared owner. |
What Problem This Solves
Fixes:
openclaw worktrees create <repoRoot>prints only "The CLI command failed. For help, runopenclaw doctor." when<repoRoot>doesn't exist (for example a typo), and--jsonshows only the raw "ENOENT: no such file or directory, realpath ''".User Impact
User impact: the command now says "Source checkout not found: . Pass the path to an existing git checkout." Exit code is unchanged, and nothing is created.
Why This Change Was Made
worktrees createresolves the source path withrealpathSync.nativebefore admission, and the rawENOENTreached the root failure renderer as an unexpected error. A missing path (ENOENT/ENOTDIR) is now reported with the existingthrowExpectedCliErrorhelper; other filesystem errors still propagate as before.Evidence
Current verification on
d8cbceafd1dd9fb8bc63712d739dc103795ce0bd(2026-11-12): mergedmainat9ca7932563ff3a8d2d3eca37e50d6ea7b031a527, preserving its consolidated invalid-request cases and newer worktree diagnostics. The PR delta remains two files, +32/-1. Independent source review found no actionable issue in the resolution.Original CLI before/after proof, unchanged production behavior: built from
mainat 67416fc on Linux, Node 24.22.2, fresh state directory.Before:
After:
Both exit 1, as before.
Tests:
pnpm test src/cli/worktrees-cli.test.ts src/cli/worktrees-cli.import-boundary.test.ts --maxWorkers=1: 21 passed on the resolved branch (20 CLI cases plus one import-boundary case). The CLI suite took 57.48 s, including 46.58 s of shared worker preparation; the boundary case took 102 ms.formatCliFailureLinespath and checks the service is never called. It fails onmainand passes with the fix.oxfmt --check, and PR-delta whitespace checks on both files: clean. Fresh CI applies to the pushed head; prior-head CI is not counted as current-head proof.