Skip to content

fix: soften doctor shell completion install failures#99309

Closed
arkyu2077 wants to merge 2 commits into
openclaw:mainfrom
arkyu2077:pr-factory/99237
Closed

fix: soften doctor shell completion install failures#99309
arkyu2077 wants to merge 2 commits into
openclaw:mainfrom
arkyu2077:pr-factory/99237

Conversation

@arkyu2077

Copy link
Copy Markdown
Contributor

Summary

  • downgrade shell completion install failures during doctor --fix into a non-blocking note
  • keep successful install/upgrade notes unchanged
  • add coverage for read-only ~/.bashrc so doctor does not fail the whole run

Testing

  • pnpm vitest run src/commands/doctor-completion.test.ts src/cli/completion-runtime.test.ts

Closes #99237

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: S triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 3, 2026
@clawsweeper

clawsweeper Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 3, 2026, 8:35 AM ET / 12:35 UTC.

Summary
The PR changes doctor shell-completion repair handling so install failures become non-fatal notes, with a regression test for an unwritable Bash profile.

PR surface: Source +37, Tests +52. Total +89 across 2 files.

Reproducibility: yes. The linked issue provides EACCES logs, and current-main source shows doctor --fix can reach doctorShellCompletion, await installCompletion, and let a profile-write exception escape through runShellCompletionHealth; I did not run a live repro in this read-only pass.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: migration/backfill/repair: src/commands/doctor-completion.test.ts, migration/backfill/repair: src/commands/doctor-completion.ts, serialized state: src/commands/doctor-completion.test.ts, unknown-data-model-change: src/commands/doctor-completion.test.ts, unknown-data-model-change: src/commands/doctor-completion.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #99237
Summary: This PR is one open candidate fix for the canonical doctor shell-completion EACCES issue; several sibling PRs target the same root cause.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add redacted terminal output, logs, or a terminal screenshot showing the after-fix doctor --fix read-only profile path exits successfully.
  • Coordinate with maintainers on which overlapping candidate PR should be canonical for the linked issue.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR body lists tests but no after-fix terminal output, logs, screenshot, or linked artifact showing doctor --fix handling an unwritable shell profile; the contributor should add redacted proof and update the PR body to trigger re-review.

Risk before merge

  • [P1] This external PR still lacks redacted after-fix terminal output, logs, a terminal screenshot, or a linked artifact showing the read-only profile doctor path exits successfully.
  • [P1] Several open PRs target the same linked doctor-completion bug, and no merged or cleanly canonical replacement has taken over yet.

Maintainer options:

  1. Decide the mitigation before merge
    Land one canonical doctor-boundary fix that downgrades optional doctor completion install failures without changing the explicit completion installer contract.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] Maintainers need to choose one overlapping candidate PR and require contributor real behavior proof before this PR can merge.

Security
Cleared: The diff only changes local doctor completion error handling and tests; it adds no dependency, workflow, credential, permission, or supply-chain surface.

Review details

Best possible solution:

Land one canonical doctor-boundary fix that downgrades optional doctor completion install failures without changing the explicit completion installer contract.

Do we have a high-confidence way to reproduce the issue?

Yes. The linked issue provides EACCES logs, and current-main source shows doctor --fix can reach doctorShellCompletion, await installCompletion, and let a profile-write exception escape through runShellCompletionHealth; I did not run a live repro in this read-only pass.

Is this the best way to solve the issue?

Yes for the code boundary: doctorShellCompletion is the narrow place to downgrade optional doctor install failures while leaving completion --install fatal for explicit use. Weakening installCompletion itself would be broader than needed, and the update flow already catches optional refresh failures at its caller boundary.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 414ecd2b9689.

Label changes

Label justifications:

  • P2: The PR targets a deterministic doctor CLI failure in locked-down shell-profile environments with limited runtime blast radius.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body lists tests but no after-fix terminal output, logs, screenshot, or linked artifact showing doctor --fix handling an unwritable shell profile; the contributor should add redacted proof and update the PR body to trigger re-review.
Evidence reviewed

PR surface:

Source +37, Tests +52. Total +89 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 39 2 +37
Tests 1 53 1 +52
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 92 3 +89

What I checked:

Likely related people:

  • shakkernerd: Commit 3fae903 added the doctor shell-completion module and doctorShellCompletion flow that owns the affected optional install behavior. (role: introduced behavior; confidence: high; commits: 3fae90386328; files: src/commands/doctor-completion.ts)
  • vincentkoc: Commit 0e54440 added the current completion-runtime surface and touched the same doctor completion import boundary. (role: adjacent completion contributor; confidence: medium; commits: 0e54440ecc39; files: src/cli/completion-runtime.ts, src/cli/update-cli/update-command.ts, src/commands/doctor-completion.ts)
  • steipete: Commit 7d6d642 moved doctor orchestration into flow contributions, including the caller path that currently awaits doctorShellCompletion. (role: doctor flow refactor author; confidence: medium; commits: 7d6d642cb825, 656848dcd7d0; files: src/flows/doctor-health-contributions.ts, src/commands/doctor-completion.ts, src/wizard/setup.completion.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete

steipete commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Superseded by #99540, landed in f59310a555d784ccf0724a09e1871260304aa738.

The landed implementation keeps one centralized recovery path while selectively downgrading only wrapped EACCES, EPERM, and EROFS profile errors. Unexpected failures still propagate, the actual failing path is retained, and both install branches have regression and built-CLI proof.

Thanks @arkyu2077 for working on this bug.

@steipete steipete closed this Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: doctor --fix exits 1 when shell-completion install hits a read-only ~/.bashrc (EACCES) — optional step fails the whole doctor run

2 participants