Doctor: normalize repair checks inside runner#83753
Conversation
|
Codex review: needs maintainer review before merge. Latest ClawSweeper review: 2026-05-23 14:43 UTC / May 23, 2026, 10:43 AM ET. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
PR Surface View PR surface stats
Summary Reproducibility: not applicable. This is an internal Doctor runner refactor rather than a reported bug; source review, focused tests, CI signal, and the PR body's Crabbox CLI proof are the relevant checks. PR rating Rank-up moves:
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. Real behavior proof Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Keep the normalized runner internal, preserve the public plugin SDK split contract, and merge only after the Doctor owner accepts the internal run-contract direction and current coverage level. Do we have a high-confidence way to reproduce the issue? Not applicable. This is an internal Doctor runner refactor rather than a reported bug; source review, focused tests, CI signal, and the PR body's Crabbox CLI proof are the relevant checks. Is this the best way to solve the issue? Unclear pending owner decision. The implementation is a plausible bounded refactor that keeps the public SDK stable and preserves split-check behavior, but the new internal Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against ef7e652ec40a. |
0d39d29 to
a6a9874
Compare
|
Fixed the P1 around optional shell completion lint noise. Verification:
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Updated the PR body with real WSL CLI proof for the shell-completion lint path after the P1 fix: pnpm openclaw doctor --lint --only core/doctor/shell-completion --jsonObserved result: {"ok":true,"checksRun":1,"checksSkipped":19,"findings":[]}@clawsweeper re-review |
|
@clawsweeper re-review Fixed the P1 by preserving the late legacy systemd linger repair pass after Verification:
|
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 Reason: re-review requires an open issue or PR. |
|
@clawsweeper re-review Updated the PR body with current-head real Doctor CLI proof from AWS Crabbox. Proof summary:
|
|
🦞👀 Command router queued. I will update this comment with the next step. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. Re-review progress:
|
|
@clawsweeper re-review The prior current-head review run for this PR was cancelled before returning a verdict. Re-requesting once for current head |
|
🦞👀 Command router queued. I will update this comment with the next step. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. Re-review progress:
|
Summary
This PR narrows the first doctor repair migration step to the core doctor runner.
detect()/repair()checks or an internal single-flowrun(ctx)check.detect()plus optionalrepair(), and no plugin SDK baseline is regenerated.repair()throws.The goal is to make the runner easier to migrate safely without asking every existing doctor check author to split one boolean repair flow immediately. Existing split checks still work through the adapter; internal checks can move to one flow when that is clearer.
Verification
Local/WSL proof:
git diff --checkOPENCLAW_OXLINT_SKIP_PREPARE=1 node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/flows/doctor-lint-flow.test.ts src/flows/doctor-repair-flow.test.ts src/flows/doctor-repair-flow.ts src/flows/health-check-adapter.ts src/flows/health-check-runner-types.tsnode scripts/run-tsgo.mjs -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core-prod-83753.tsbuildinfonode scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core-test-83753-pr1-contract.tsbuildinfonode scripts/run-vitest.mjs src/flows/doctor-repair-flow.test.ts src/flows/doctor-lint-flow.test.ts— 2 files / 14 tests passedCrabbox real CLI proof on current head:
cbx_cb0b70795a87run_85627cfd426cd139d39e884019ce5de521660ba382a0499a1575OPENCLAW_HOMEwith legacy browser residue, thendoctor --lint --only core/doctor/browser-clawd-profile-residue --json,doctor --fix --yes --non-interactive --no-workspace-suggestions, and the same lint command again.Crabbox transcript excerpt, with temp home redacted:
Real behavior proof
Behavior addressed: Doctor repair runner now has one internal normalized execution path while preserving existing split-check repair error behavior, lint behavior, repair behavior, dry-run/diff previews, effects, warnings, config updates, and validation behavior.
Real environment tested: AWS Crabbox Linux VM (
cbx_cb0b70795a87) from current PR headd139d39e884019ce5de521660ba382a0499a1575.Exact steps or command run after this patch: created a disposable
OPENCLAW_HOMEwith legacybrowser/clawdresidue, randoctor --lint --only core/doctor/browser-clawd-profile-residue --json, randoctor --fix --yes --non-interactive --no-workspace-suggestions, then reran the same lint check.Evidence after fix: before lint reported
core/doctor/browser-clawd-profile-residue;doctor --fixarchived the legacyclawdbrowser profile residue; after lint returned{"ok":true,"checksRun":1,"checksSkipped":16,"findings":[]}.Observed result after fix: the public plugin SDK health surface remains unchanged, the core doctor runner adapts split checks and internal run checks, and a real repair-backed converted doctor check works through CLI lint/fix/lint on the pushed head.
What was not tested: full release/package acceptance lanes; this PR does not touch package installation or plugin SDK exports.