Repository navigation
fix(cli): show clean errors for missing input files - #105874
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 18, 2026, 1:32 AM ET / 05:32 UTC. Summary PR surface: Source +38, Tests +48. Total +86 across 6 files. Reproducibility: yes. The three missing-path inputs have direct source paths and focused regression tests, and the PR body reports built-CLI runs that exit 1 with the intended text without invoking configuration writes or secrets apply. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Next step before merge
Security Review detailsBest possible solution: Merge the narrow command-owned Do we have a high-confidence way to reproduce the issue? Yes. The three missing-path inputs have direct source paths and focused regression tests, and the PR body reports built-CLI runs that exit 1 with the intended text without invoking configuration writes or secrets apply. Is this the best way to solve the issue? Yes. Translating only AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6709693d3958. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +38, Tests +48. Total +86 across 6 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (15 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
853a90d to
e373b9f
Compare
e373b9f to
a3e5b09
Compare
…ppress cause leak
f09588b to
bff83b5
Compare
|
Merged via squash.
|
* fix(cli): wrap readFileSync ENOENT with user-friendly messages and suppress cause leak * fix(secrets): type missing plan errors * style(secrets): format missing plan error branch --------- Co-authored-by: Peter Steinberger <[email protected]>
* fix(cli): wrap readFileSync ENOENT with user-friendly messages and suppress cause leak * fix(secrets): type missing plan errors * style(secrets): format missing plan error branch --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Three CLI input paths exposed raw Node.js
ENOENTtext when the user supplied a missing file:openclaw config set --batch-file <path>openclaw config patch --file <path>openclaw secrets apply --from <path>The raw filesystem error is noisy and less actionable than naming the flag and user-supplied path.
Solution
ENOENTat each command-owned file-read boundary using the sharedhasErrnoCodeguard.cause; rethrow every non-ENOENTfailure unchanged.Behavior
The three commands now exit 1 with these messages:
No parse, config write, or secrets apply operation runs after the missing input is detected.
Evidence
tbx_01kxstbgzscnwa3jeeqyr62j8h:pnpm test src/cli/config-set-input.test.ts src/cli/config-cli.test.ts src/cli/secrets-cli.test.ts— 160 passed.ENOENTnorno such file or directory.patch is correct, 0.98).git diff --check— clean.Risk
Low. Success paths are unchanged. Classification is limited to
ENOENT; permission, parse, validation, and provider errors keep their existing handling.