Repository navigation
fix: doctor service repair promises defaults it cannot apply - #166950
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: needs maintainer review before merge. Reviewed October 8, 2026, 2:28 AM ET / 06:28 UTC (Revision 7). ClawSweeper reviewWhat this changesDoctor previews the selected Gateway service repair before consent, repeats retained runtime and source-checkout findings afterward, and preserves the selected profile in replacement guidance. Example: Run Doctor with profile proof166950 and no supported system Node
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR remains useful and is ready for ordinary landing review: current main retains the misleading promise, exact-head native proof covers the bounded change, and no blocking defect was found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherDoctor inspects the native service that runs the OpenClaw Gateway and offers eligible repairs. It consumes service audit facts and the existing installer’s plan, then presents those facts before asking the operator for consent. flowchart TD
A[Doctor command] --> B[Installed service and audit facts]
B --> C[Existing installer plan]
C --> D[Repair preview and retained findings]
D --> E{Operator consent}
E -->|Decline| F[Profile-aware guidance]
E -->|Approve| G[Existing guarded service installer]
G --> H[Repeat retained findings]
Technical reviewBest possible solution: Keep repair decisions with the existing installer and audit owners while accurately showing the selected plan and its remaining findings before consent. Do we have a high-confidence way to reproduce the issue? Yes: current-main source combines runtime-preserving installation with a promise of recommended defaults; supplied native CLI evidence exercises the repaired missing-system-Node scenario. This read-only review did not execute the baseline. Is this the best way to solve the issue? Yes: presenting existing plan and audit facts fixes the misleading promise without changing runtime selection, service authority, or stored settings. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 467fc82c4fd9. Provenance checked
TestingProof path: shipped entry point. Added test files: 1. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +75, Tests +159, Docs +1. Total +235 across 4 files. View PR surface stats
Stored data modelPersistent data-model change detected: LabelsLabel changes: No label 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 HistoryReview history (6 earlier review cycles)
|
|
The PR body now includes a passing published OpenClaw 2026.9.8 → exact candidate 1b86e40f57bf6950916512dc3fb8046e2c3dfa10 compatibility cell, with successful durable update completion, authenticated serving identity/readiness and state-continuity assertions. It also explains why the path-based data-model flags do not represent schema or data-format changes, and distinguishes the synthetic service manager from real CLI/runtime/SQLite execution. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Completed the requested actual installed CLI + real terminal + native launchd proof on final head Exact-head native CLI proofReviewed head: Built with the canonical On macOS gui/501, used real launchd job Real command, repeated in real PTYs: node <installed-tarball>/openclaw.mjs --profile proof166950 doctorThe real installer initially created the named service. Removing only its generated RunAtLoad key produced an actual recognized outdated-definition finding. Both Doctor runs showed Runtime, Entrypoint, PATH and
Immutable before/after evidence:
Relevant literal terminal excerpts (normal wrapping omitted here; full PTY transcripts and snapshots were captured): The source-checkout hint branch uses real-formatting boundary regressions rather than this npm native run. Three profile assertions failed on the previous code for the intended missing-selector reason, then all three passed after using the existing command formatter. Final focused runner exit 0, selected official lint exit 0, formatting check exit 0, independent P2 source/runtime review clean. The native profile's unrelated disabled-plugin/model/skill/cron notices were preserved; this proof makes no inference or external-channel claim. Cleanup: actual Hosted CI is held only on the proven identical main Discord TS2304 ( @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
4e5223a to
b46ff6d
Compare
Exact-head native CLI proofReviewed head: Built with the canonical On macOS gui/501, used real launchd job Real command, repeated in real PTYs: node <installed-tarball>/openclaw.mjs --profile proof166950 doctorThe real installer initially created the named service. Removing only its generated RunAtLoad key produced an actual recognized outdated-definition finding. Both Doctor runs showed Runtime, Entrypoint, PATH and
Immutable before/after evidence:
Relevant literal terminal excerpts (normal wrapping omitted here; full PTY transcripts and snapshots were captured): The source-checkout hint branch uses real-formatting boundary regressions rather than this npm native run. Three profile assertions failed on the previous code for the intended missing-selector reason, then all three passed after using the existing command formatter. Final focused runner exit 0, selected official lint exit 0, formatting check exit 0, independent P2 source/runtime review clean. The native profile's unrelated disabled-plugin/model/skill/cron notices were preserved; this proof makes no inference or external-channel claim. Cleanup: actual Rebase validation: the canonical full typed build completed in 5m 52s and package integrity checks passed. Installed tarball provenance matches the rebased head; both actual PTY commands exited 0. The serialized focused regression runner passed all three tests in 104.87s. An initial parallel test attempt correctly refused compiler snapshot sealing because the canonical package owner changed generated namespaces; no test assertions ran in that attempt. It was rerun after the package owner finished, without bypassing integrity checks. The previous 4e5223 proof remains historical and is not relabeled. Source formatting/lint and independent review remain unchanged by the identical rebased hint patch. @clawsweeper re-review Please review the current rebased head and the proper live proof above within this PR’s bounded service-repair-preview scope. The wider restart/Doctor incident is deliberately split across five independently reviewed PRs. |
|
🦞👀 Re-review progress:
|
…w#166950) * fix: preview doctor service repairs and retained findings * fix(doctor): preserve profile in service repair guidance
What Problem This Solves
Fixes Doctor promising recommended service defaults when reinstalling will retain the same version-managed runtime or source-checkout entrypoint that it just warned about.
User Impact
Operators see the planned runtime, entrypoint, PATH, shutdown-budget repair, and unresolved runtime/source findings before approving a service rewrite. Approved repairs repeat the findings they leave unresolved. Reinstall can repair other settings while retaining the runtime when no supported system Node is available.
Why This Change Was Made
Describe the existing install plan and audit facts before consent instead of changing runtime selection or overriding an operator's launcher. The confirmation asks to apply the displayed repair. No schema, config shape, service ownership, authentication, runtime pin, updater, or native install behavior changes.
Evidence
pnpm test src/commands/doctor-gateway-service-preview.test.ts --maxWorkers=1passed three tests in 80.80 s command wall (63.19 s Vitest, under 100 ms test execution). Most time was worker artifact/import preparation. The actual service-repair boundary is needed to prove preview-before-consent, declined repair behavior, and selected runtime matching the install plan; a formatter-only test would miss those contracts. No per-test process/Gateway boots, sleeps, or polling were added. CI seconds are not yet available.Published-updater compatibility proof
Passed the canonical isolated published-driver cell (exit 0): published OpenClaw 2026.9.8 updated to exact candidate 1b86e40f57bf6950916512dc3fb8046e2c3dfa10, package SHA-256 e05a59613df79d385ede12922775e5393ee20e6767d58e40c229c7cecd8b948a. The durable update ledger finished successfully; authenticated Gateway serving identity matched the candidate, readyz returned HTTP 200, durable session content and identity survived, incognito content was removed, orphan OAuth sidecar bytes were preserved, and the managed PID was replaced. The published updater command completed in 895.0 s including cleanup; full cell was approximately 16 minutes within the canonical 1125 s envelope. No budget or retry policy was changed.
Reproduction: build/package this exact head through the canonical owner, then run
bash scripts/e2e/published-driver-update-docker.sh /absolute/candidate.tgz /absolute/proof-dir 2026.9.8. This ran in disposable Docker HOME/state with real published CLI, candidate runtime and SQLite, using the existing synthetic Linux systemctl adapter. It does not prove macOS launchd or the interactive consent UI; those changed decisions are covered by the approval/decline boundary regressions above. No operator service, configuration, secrets or database was used. Owned runtime/service/container/volume cleanup completed.No stored schema, data format, migration transform or config publication is introduced. The path-based stored-data flag identifies Doctor-related files rather than a new data-model contract; the successful published-driver cell confirms compatibility on the seeded upgrade path.
Profile-safe repair guidance
The native proof exposed three service-install hints that dropped the selected profile. They now use the existing command formatter; three fail-first profile regressions, selected official lint/format and independent P2 review passed. Runtime selection, repair eligibility and native publication remain with existing owners.
Current-head CI
Head
b46ff6d17b4e8fd1697f690b84c7441662c825bbpasses full hosted CI and the CI status gate. An earlier unrelated main Discord type failure was fixed upstream; this branch was cleanly rebased and its canonical package, native CLI proof and focused regressions were repeated. No CI exception or proof waiver remains. Prior-head proof is historical, not relabeled.Exact-head native CLI proof
Reviewed head:
b46ff6d17b4e8fd1697f690b84c7441662c825bb. This proof covers the bounded repair-preview, consent, retained-findings, and profile-aware mutation-guidance behavior of this PR, rather than the full related restart/Doctor outage or runtime migration.Built with the canonical
scripts/package-openclaw-for-docker.mts --allow-unreleased-changelogowner, including full typed build and package import-graph/tarball integrity checks; all completed with exit 0. Installed the produced tarball with realnpm install --prefix <task-owned-prefix> --omit=dev --no-audit --no-fund(lifecycle scripts enabled), then verified installeddist/build-info.jsonnames this exact commit. Build identity:2026.9.8-b46ff6d17b4e-2026-10-08T06-06-54.746Z. Tarball SHA-256:fd77009421414be42f356177f04f6b6e09f2e41c0b7e5417865a18ffbaf13056.On macOS gui/501, used real launchd job
ai.openclaw.proof166950, canonical named-profile state, port 19650, actual supported NVM Node v24.16.0, and the host's actual absence of supported system Node. The native CLI used the OS account home required by its service guard, anenv -ienvironment without inherited API/GitHub credentials, and explicit--profile proof166950. The profile/config/plist were absent and the job unloaded/port free before setup. Only synthetic token-auth profile state was created; plugin loading and Tailscale were disabled. No native command, transport, filesystem, config owner, or installer was mocked.Real command, repeated in real PTYs:
The real installer initially created the named service. Removing only its generated RunAtLoad key produced an actual recognized outdated-definition finding. Both Doctor runs showed Runtime, Entrypoint, PATH and
Will remain: No supported system Node is availablebefore askingApply the gateway service repair shown above now?. Other config/skill/shell-completion changes were declined.Gateway service findings still unresolvedrepeated the missing-system-Node finding. The installer deliberately retained the actual NVM executable; no system runtime was added.openclaw --profile proof166950 gateway install --force.Immutable before/after evidence:
f058f1d4ef7bad99dff83291565db234ef9b180e5d252b81c84ab14146b296a4.a236bb4f3f3e1b5f649e1ab01d57b5c9cc27c7c6f007b64e1dd49da063658384.334b88442493140bbf7fa0e9547f1c2070eaf22fe93b97f04d2276e9ed33ab4f(matches original installer definition).Relevant literal terminal excerpts (normal wrapping omitted here; full PTY transcripts and snapshots were captured):
The source-checkout hint branch uses real-formatting boundary regressions rather than this npm native run. Three profile assertions failed on the previous code for the intended missing-selector reason, then all three passed after using the existing command formatter. Final focused runner exit 0, selected official lint exit 0, formatting check exit 0, independent P2 source/runtime review clean. The native profile's unrelated disabled-plugin/model/skill/cron notices were preserved; this proof makes no inference or external-channel claim.
Cleanup: actual
--profile proof166950 gateway stop --forceexited 0; launchctl confirmed the named job absent, port 19650 was free, and only task-owned profile state, plist, generated reconciliation backups and newly created profile log were removed. The operator's default service, config, runtime installation, Tailscale and credentials were untouched.Rebase validation: the canonical full typed build completed in 5m 52s and package integrity checks passed. Installed tarball provenance matches the rebased head; both actual PTY commands exited 0. The serialized focused regression runner passed all three tests in 104.87s. An initial parallel test attempt correctly refused compiler snapshot sealing because the canonical package owner changed generated namespaces; no test assertions ran in that attempt. It was rerun after the package owner finished, without bypassing integrity checks. The previous 4e5223 proof remains historical and is not relabeled. Source formatting/lint and independent review remain unchanged by the identical rebased hint patch.