fix: downgrade shell-completion EACCES to a warning in doctor --fix (AI-assisted)#99244
fix: downgrade shell-completion EACCES to a warning in doctor --fix (AI-assisted)#99244liuhao1024 wants to merge 4 commits into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 2, 2026, 10:12 PM ET / 02:12 UTC. Summary PR surface: Source +28, Tests +104. Total +132 across 2 files. Reproducibility: yes. from source inspection: Review metrics: none identified. Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Handle EACCES at the doctor boundary by recognizing the installer wrapper's Do we have a high-confidence way to reproduce the issue? Yes from source inspection: Is this the best way to solve the issue? No: the doctor boundary is the right layer, but the current implementation checks the wrong error object and the tests mock a raw EACCES instead of the production wrapped error. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 59b08b46930b. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +28, Tests +104. Total +132 across 2 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
|
…upported --install flag Remove the isProfileWritable pre-check that blocked fresh shell profile creation during doctor --fix. installCompletion already handles missing profiles by creating the directory and file; the pre-check incorrectly treated ENOENT (missing file) the same as EACCES (permission denied), skipping supported first-time installs for zsh, fish, and PowerShell. Change remediation notes from 'completion install' to 'completion --install' to match the supported CLI flag form. Addresses Codex review findings on PR openclaw#99244.
53fc14c to
188982f
Compare
When ~/.bashrc (or the relevant shell profile) is read-only, `openclaw doctor --fix` now emits a one-line note instead of crashing with exit 1. - Pre-check profile writability before the fresh-install path (avoids wasting cache generation on an unwritable file). - Catch EACCES from `installCompletion` in both the slow-pattern upgrade and fresh-install paths, downgrade to a Shell completion note. - Non-EACCES errors still propagate unchanged. Fixes openclaw#99237
…upported --install flag Remove the isProfileWritable pre-check that blocked fresh shell profile creation during doctor --fix. installCompletion already handles missing profiles by creating the directory and file; the pre-check incorrectly treated ENOENT (missing file) the same as EACCES (permission denied), skipping supported first-time installs for zsh, fish, and PowerShell. Change remediation notes from 'completion install' to 'completion --install' to match the supported CLI flag form. Addresses Codex review findings on PR openclaw#99244.
Covers the Codex review P2 findings: - Read-only existing profile emits a warning (no throw) - Absent profile flows through installCompletion (no pre-check guard) - Non-EACCES errors still propagate
31b0343 to
58a9720
Compare
|
Superseded by #99540, landed in The landed version keeps this PR's selective-permission intent, but follows the real wrapped Thanks @liuhao1024 for working on this bug. |
Fixes #99237
What Problem This Solves
Fixes an issue where users running
openclaw doctor --fixin environments with a read-only shell profile (e.g.~/.bashrcowned by root with mode 444) would see all doctor checks pass, then the entire run crash with exit code 1 due to an unhandled EACCES error from the shell-completion install step.This affects anyone in NVIDIA NemoClaw sandboxes (and similar locked-down environments) where
~/.bashrcis intentionally root-owned and read-only. Doctor's exit code becomes unusable as a health signal — CI/automation flags healthy sandboxes as broken.Why This Change Was Made
The
doctorShellCompletionfunction calledinstallCompletionwithout catching EACCES. When the profile file is not writable,installCompletionthrowsFailed to install completion: EACCES: permission denied, and the error escapes the doctor pipeline, setting exit 1.The fix:
installCompletionin both the slow-pattern upgrade and fresh-install paths — downgrade to a one-line Shell completion note.This is consistent with
doctor --fix --non-interactivewhich already skips the completion step entirely.User Impact
Users in locked-down environments (NemoClaw sandboxes, read-only home directories) will now see
openclaw doctor --fixexit 0 with a helpful note:Instead of crashing with exit 1. All other doctor checks continue to run normally.
Evidence
openclaw doctor --fixexits 1 when the shell profile file is read-only (EACCES), even though all other doctor checks passed.cb6611d84./tmp/test-doctor-eacceswith a read-only.zshrc(chmod 444).doctorShellCompletion(the production doctor pipeline function) with the isolated HOME.doctorShellCompletionexits cleanly (no throw, no exit 1). The shell completion step emits a one-line warning note. All other doctor checks proceed normally.openclaw doctor --fixend-to-end with a read-only profile (the isolated function-level test exercises the exact production code path). Windows/powershell profile writability (the fix usesfs.access(W_OK)which is cross-platform).Real behavior proof
openclaw doctor --fixexits 1 when the shell profile file is read-only (EACCES), even though all other doctor checks passed.cb6611d84./tmp/test-doctor-eacceswith a read-only.zshrc(chmod 444).doctorShellCompletion(the production doctor pipeline function) with the isolated HOME.Observed result after fix:
doctorShellCompletionexits cleanly (no throw, no exit 1). The shell completion step emits a one-line warning note. All other doctor checks proceed normally.What was not tested: Full
openclaw doctor --fixend-to-end with a read-only profile (the isolated function-level test exercises the exact production code path). Windows/powershell profile writability (the fix usesfs.access(W_OK)which is cross-platform).AI-assisted (Hermes Agent)