Skip to content

fix: doctor service repair promises defaults it cannot apply - #166950

Merged
RomneyDa merged 2 commits into
mainfrom
fix/doctor-service-repair-preview
Oct 9, 2026
Merged

RomneyDa merged 2 commits into
mainfrom
fix/doctor-service-repair-preview

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

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

  • All three boundary regression cases failed on the original Doctor service-repair owner because it provided no preview.
  • Regression cases cover approval/decline with missing system Node and a retained source checkout, plus selection of a supported system Node. They also check that the displayed runtime matches the approved install plan.
  • 67 service, authority, writer-order, and preview tests passed (556.72 s command wall, including cold artifacts and real isolated writer/authority fixtures). All 44 service/preview boundary tests passed after the audit-owner extraction (250.64 s command wall, including a cold artifact build). The final three preview boundary cases passed again, including empty PATH formatting (37.14 s shard wall, 29.11 s Vitest). Independent autoreview through P2 on the final production implementation: scoped-clean. Full selected changed checks passed (exit 0): formatting, documentation/ownership/ratchet guards, core production types, 27 core-test graphs, dead exports, core lint, and trailing schema/store/media/sidecar/import/webhook/pairing guards.
  • New preview file: pnpm test src/commands/doctor-gateway-service-preview.test.ts --maxWorkers=1 passed 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.
  • Synthetic native-service and runtime responses; isolated source-checkout fixture. No operator service, runtime, config, or secrets were modified. The boundary fixtures use synthetic native-service adapters; the separate published-driver cell below supplies real CLI/runtime/SQLite compatibility evidence. No live macOS LaunchAgent was exercised.

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 b46ff6d17b4e8fd1697f690b84c7441662c825bb passes 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-changelog owner, including full typed build and package import-graph/tarball integrity checks; all completed with exit 0. Installed the produced tarball with real npm install --prefix <task-owned-prefix> --omit=dev --no-audit --no-fund (lifecycle scripts enabled), then verified installed dist/build-info.json names 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, an env -i environment 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:

node <installed-tarball>/openclaw.mjs --profile proof166950 doctor

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 available before asking Apply the gateway service repair shown above now?. Other config/skill/shell-completion changes were declined.

Outcome Actual result
Decline service repair CLI exit 0; PID 81447, config and plist bytes unchanged; /healthz and /readyz remained 200.
Approve service repair CLI exit 0; real installer reconciled RunAtLoad=true; PID 81447 → 90529; config bytes unchanged; runtime, entrypoint and PATH matched the selected preview.
Retained runtime finding After installation, Gateway service findings still unresolved repeated the missing-system-Node finding. The installer deliberately retained the actual NVM executable; no system runtime was added.
Fresh readiness observation After the approved real installation, both /healthz and /readyz returned 200; this is separately observed readiness, not inferred from installer output.
Correct profile guidance Decline printed the install guidance with openclaw --profile proof166950 gateway install --force.

Immutable before/after evidence:

  • Config SHA-256 throughout: f058f1d4ef7bad99dff83291565db234ef9b180e5d252b81c84ab14146b296a4.
  • Outdated plist before and after decline: a236bb4f3f3e1b5f649e1ab01d57b5c9cc27c7c6f007b64e1dd49da063658384.
  • Repaired plist after approval: 334b88442493140bbf7fa0e9547f1c2070eaf22fe93b97f04d2276e9ed33ab4f (matches original installer definition).

Relevant literal terminal excerpts (normal wrapping omitted here; full PTY transcripts and snapshots were captured):

OpenClaw 2026.9.8 (b46ff6d)
Gateway service repair preview
Runtime: /Users/dallin/.nvm/versions/node/v24.16.0/bin/node -> /Users/dallin/.nvm/versions/node/v24.16.0/bin/node
Will remain: No supported system Node is available; this repair retains /Users/dallin/.nvm/versions/node/v24.16.0/bin/node.
Apply the gateway service repair shown above now?
No
Run `openclaw --profile proof166950 gateway install --force` when you want to replace the gateway service definition.
Apply the gateway service repair shown above now?
Yes
Installed LaunchAgent: /Users/dallin/Library/LaunchAgents/ai.openclaw.proof166950.plist
Reconciled Gateway service definition: RunAtLoad.
Gateway service findings still unresolved
No supported system Node is available; this repair retains /Users/dallin/.nvm/versions/node/v24.16.0/bin/node.
Doctor complete.

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 --force exited 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.

@clawsweeper

clawsweeper Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime commands Command implementations size: M labels Oct 8, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 8, 2026
@clawsweeper

clawsweeper Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 8, 2026, 2:28 AM ET / 06:28 UTC (Revision 7).

ClawSweeper review

What this changes

Doctor 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

  • Before: Doctor asks to apply recommended defaults even though the installer retains the version-managed Node runtime.
  • After: Doctor displays the retained runtime before consent and prints openclaw --profile proof166950 gateway install --force when repair is declined.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused, useful repair with exact-head native CLI proof, meaningful boundary regressions, and no open correctness or security finding.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): Exact-head installed CLI runs against real macOS launchd show the preview before consent, unchanged service/config on decline, repaired RunAtLoad and fresh readiness on approval, repeated retained-runtime findings, and profile-safe guidance. Source inspection confirms no stored-data contract change; older upgrade replay remains supplementary historical evidence.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Operators are asked to approve recommended service defaults even when the repair will retain the runtime or source-checkout launcher Doctor warned about.
Reason: Accurate consent and profile-safe recovery guidance solve a concrete diagnostic defect. The bounded patch preserves the established runtime and native-service contracts.

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
Reviewed head: b46ff6d17b4e8fd1697f690b84c7441662c825bb

Before merge

None.

Findings

None.

Agent review details

How this fits together

Doctor 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]
Loading

Technical review

Best 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

  • src/commands/doctor-gateway-services.ts service-audit panel consolidation keeps the original intent (fix(doctor): consolidate Gateway service config panels into a single note (#80287) #78688: Consolidate source-checkout and audit findings while avoiding duplicate entrypoint warnings and replacement guidance.)
  • src/commands/doctor-gateway-services.ts repair confirmation wording changes intended behavior with a stated reason (01641b3: The introducing commit adds supervisor-config auditing and documentation; no more specific rationale for the defaults wording was available.)
  • src/commands/doctor-gateway-services.ts service replacement guidance keeps the original intent (fix: point Doctor service recovery to the right commands #137505: Refer operators to commands that actually own installation, startup, and service-definition replacement without broadening Doctor maintenance authority.)

Testing

Proof path: shipped entry point. Added test files: 1.

Security

None.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • YB0y: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

PR surface

Source +75, Tests +159, Docs +1. Total +235 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 98 23 +75
Tests 1 159 0 +159
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 258 23 +235

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/commands/doctor-service-audit.ts, unknown-data-model-change: src/commands/doctor-gateway-services.ts, unknown-data-model-change: src/commands/doctor-service-audit.ts. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Misleading service-repair consent and profile guidance are bounded operator-facing defects without an introduced outage or authority change.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (6 earlier review cycles)
  • reviewed 2026-10-08T03:46:44.445Z sha 1b86e40f57bf6950916512dc3fb8046e2c3dfa10 :: blocked before merge. :: none
  • reviewed 2026-10-08T03:53:57.016Z sha 1b86e40f57bf6950916512dc3fb8046e2c3dfa10 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-08T04:29:16.898Z sha 1b86e40f57bf6950916512dc3fb8046e2c3dfa10 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-08T05:54:13.170Z sha 4e5223ac1d03ac1aeb64f000de5aeab1d0612649 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-08T06:01:23.532Z sha 4e5223ac1d03ac1aeb64f000de5aeab1d0612649 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-08T06:11:14.784Z sha b46ff6d :: needs maintainer review before merge. :: none

@RomneyDa
RomneyDa marked this pull request as ready for review October 8, 2026 03:50
@RomneyDa

RomneyDa commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

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

@clawsweeper

clawsweeper Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@RomneyDa

RomneyDa commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

Completed the requested actual installed CLI + real terminal + native launchd proof on final head 4e5223ac1d03ac1aeb64f000de5aeab1d0612649, including the profile-safe guidance cleanup discovered during proof. Maintainer-requested scope is the service repair preview/consent/unresolved-findings opportunity within five independent incident PRs; this PR does not claim full runtime migration or the entire linked crash-loop fix. Full final-head provenance, literal terminal excerpts and native snapshots are now in the body.

Exact-head native CLI proof

Reviewed head: 4e5223ac1d03ac1aeb64f000de5aeab1d0612649. 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-changelog owner, including full typed build and package import-graph/tarball integrity checks; all completed with exit 0. Installed the produced tarball with real npm install --prefix <task-owned-prefix> --omit=dev --no-audit --no-fund (lifecycle scripts enabled), then verified installed dist/build-info.json names this exact commit. Build identity: 2026.9.8-4e5223ac1d03-2026-10-08T05-47-06.010Z. Tarball SHA-256: 0becef1bd206bbe6a37b1334f346c4481041477b96bf13394e4466f3ed7f4a5c.

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, an env -i environment 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:

node <installed-tarball>/openclaw.mjs --profile proof166950 doctor

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 available before asking Apply the gateway service repair shown above now?. Other config/skill/shell-completion changes were declined.

Outcome Actual result
Decline service repair CLI exit 0; PID 66565, config and plist bytes unchanged; /healthz and /readyz remained 200.
Approve service repair CLI exit 0; real installer reconciled RunAtLoad=true; PID 66565 → 75447; config bytes unchanged; runtime, entrypoint and PATH matched the selected preview.
Retained runtime finding After installation, Gateway service findings still unresolved repeated the missing-system-Node finding. The installer deliberately retained the actual NVM executable; no system runtime was added.
Fresh readiness observation After the approved real installation, both /healthz and /readyz returned 200; this is separately observed readiness, not inferred from installer output.
Correct profile guidance Decline printed the install guidance with openclaw --profile proof166950 gateway install --force.

Immutable before/after evidence:

  • Config SHA-256 throughout: 61937156a2a73b64d7efdc7f78793bfc7ebe13cd96580615da173b8e22d5def1.
  • Outdated plist before and after decline: 7f6571ccaaadfcb8be714a963706e607fc754a4c70074688c5501332ac4da31e.
  • Repaired plist after approval: 179f01c48ff0bd08dbe8755302c67ce5f0abcd6c83738ce7dd74e134298ff462 (matches original installer definition).

Relevant literal terminal excerpts (normal wrapping omitted here; full PTY transcripts and snapshots were captured):

OpenClaw 2026.9.8 (4e5223a)
Gateway service repair preview
Runtime: /Users/dallin/.nvm/versions/node/v24.16.0/bin/node -> /Users/dallin/.nvm/versions/node/v24.16.0/bin/node
Will remain: No supported system Node is available; this repair retains /Users/dallin/.nvm/versions/node/v24.16.0/bin/node.
Apply the gateway service repair shown above now?
No
Run `openclaw --profile proof166950 gateway install --force` when you want to replace the gateway service definition.
Apply the gateway service repair shown above now?
Yes
Installed LaunchAgent: /Users/dallin/Library/LaunchAgents/ai.openclaw.proof166950.plist
Reconciled Gateway service definition: RunAtLoad.
Gateway service findings still unresolved
No supported system Node is available; this repair retains /Users/dallin/.nvm/versions/node/v24.16.0/bin/node.
Doctor complete.

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 --force exited 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.

Hosted CI is held only on the proven identical main Discord TS2304 (resetProgressState), with linked main/PR job evidence in the body, as explicitly allowed by the operator. PR-owned focused checks, canonical build/package and actual native proof passed. No proof waiver, CI bypass or rating override is requested.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Oct 8, 2026
@RomneyDa
RomneyDa force-pushed the fix/doctor-service-repair-preview branch from 4e5223a to b46ff6d Compare October 8, 2026 06:05
@RomneyDa

RomneyDa commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

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-changelog owner, including full typed build and package import-graph/tarball integrity checks; all completed with exit 0. Installed the produced tarball with real npm install --prefix <task-owned-prefix> --omit=dev --no-audit --no-fund (lifecycle scripts enabled), then verified installed dist/build-info.json names 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, an env -i environment 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:

node <installed-tarball>/openclaw.mjs --profile proof166950 doctor

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 available before asking Apply the gateway service repair shown above now?. Other config/skill/shell-completion changes were declined.

Outcome Actual result
Decline service repair CLI exit 0; PID 81447, config and plist bytes unchanged; /healthz and /readyz remained 200.
Approve service repair CLI exit 0; real installer reconciled RunAtLoad=true; PID 81447 → 90529; config bytes unchanged; runtime, entrypoint and PATH matched the selected preview.
Retained runtime finding After installation, Gateway service findings still unresolved repeated the missing-system-Node finding. The installer deliberately retained the actual NVM executable; no system runtime was added.
Fresh readiness observation After the approved real installation, both /healthz and /readyz returned 200; this is separately observed readiness, not inferred from installer output.
Correct profile guidance Decline printed the install guidance with openclaw --profile proof166950 gateway install --force.

Immutable before/after evidence:

  • Config SHA-256 throughout: f058f1d4ef7bad99dff83291565db234ef9b180e5d252b81c84ab14146b296a4.
  • Outdated plist before and after decline: a236bb4f3f3e1b5f649e1ab01d57b5c9cc27c7c6f007b64e1dd49da063658384.
  • Repaired plist after approval: 334b88442493140bbf7fa0e9547f1c2070eaf22fe93b97f04d2276e9ed33ab4f (matches original installer definition).

Relevant literal terminal excerpts (normal wrapping omitted here; full PTY transcripts and snapshots were captured):

OpenClaw 2026.9.8 (b46ff6d)
Gateway service repair preview
Runtime: /Users/dallin/.nvm/versions/node/v24.16.0/bin/node -> /Users/dallin/.nvm/versions/node/v24.16.0/bin/node
Will remain: No supported system Node is available; this repair retains /Users/dallin/.nvm/versions/node/v24.16.0/bin/node.
Apply the gateway service repair shown above now?
No
Run `openclaw --profile proof166950 gateway install --force` when you want to replace the gateway service definition.
Apply the gateway service repair shown above now?
Yes
Installed LaunchAgent: /Users/dallin/Library/LaunchAgents/ai.openclaw.proof166950.plist
Reconciled Gateway service definition: RunAtLoad.
Gateway service findings still unresolved
No supported system Node is available; this repair retains /Users/dallin/.nvm/versions/node/v24.16.0/bin/node.
Doctor complete.

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 --force exited 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.

@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.

@clawsweeper

clawsweeper Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@RomneyDa
RomneyDa merged commit bfe4592 into main Oct 9, 2026
136 checks passed
@RomneyDa
RomneyDa deleted the fix/doctor-service-repair-preview branch October 9, 2026 18:29
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 10, 2026
…w#166950)

* fix: preview doctor service repairs and retained findings

* fix(doctor): preserve profile in service repair guidance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant