Repository navigation
fix(doctor): activate a stopped Gateway only on a positive ownership verdict - #160083
Conversation
…tion Classify fresh inspection before service-config repair and again before activation. Initially stopped Gateways remain untouched on inconclusive inspection, while Doctor-owned stops retain best-effort restoration and verified running services retain health checks. Refs #159577. Pre-fix controls reproduced unwanted starts/restarts. Final owner suite passed 3x locally; 32 importer files and the five-suite 3x matrix passed on Testbox tbx_01m3jx5am10xv49bp07664y9an. Final check-changed and direct-route P1 autoreview passed.
|
🦞👀 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 real behavior proof before merge. Reviewed September 29, 2026, 5:28 AM ET / 09:28 UTC (Revision 6). ClawSweeper reviewWhat this changesDoctor now starts an already-stopped Gateway only after fresh inspection verifies ownership and offline state, and adds recovery guidance and fault-case tests. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 7 items remain Keep open. Current main still starts a managed Gateway after an inconclusive Doctor restoration inspection, so this follow-up remains useful. Native authority proof and acceptance of the changed recovery behavior remain unresolved. Priority: P1 Review scores
Verification
How this fits togetherDoctor repairs OpenClaw state and may restore a managed Gateway afterward. It inspects the service, may repair its definition, then asks the platform service manager to activate it and checks readiness. flowchart LR
A[Doctor repair] --> B[Service inspection]
B --> C[Ownership and offline verdict]
C --> D{Activation allowed?}
D -->|Yes| E[Native service action]
D -->|No| F[Recovery warning]
E --> G[Readiness check]
Decision needed
Why: The PR intentionally trades automatic recovery for a stronger activation boundary; accepting the resulting operator impact requires maintainer intent and upgrade evidence. Before merge
Findings
Agent review detailsSecurityNeeds attention: Native activation still lacks demonstrated rejection of a launcher replaced after Doctor's verdict; the diff adds no supply-chain dependency. PR surfaceSource +73, Tests +119, Docs +4. Total +196 across 5 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep Doctor's positive-verdict gate in its restoration owner, bind the verified launcher to the final native effect, and leave clear recovery guidance when authority cannot be established. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main records an inconclusive restoration inspection and then calls the service start fallback. This read-only review did not run a native reproduction. Is this the best way to solve the issue? Unclear pending native final-effect proof. Doctor restoration is the narrow owner for the gate, but the final service action must still honor the verified launcher. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c82063902aa1. LabelsLabel changes: No label changes. Label justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
…tion (openclaw#160083) Classify fresh inspection before service-config repair and again before activation. Initially stopped Gateways remain untouched on inconclusive inspection, while Doctor-owned stops retain best-effort restoration and verified running services retain health checks. Refs openclaw#159577. Pre-fix controls reproduced unwanted starts/restarts. Final owner suite passed 3x locally; 32 importer files and the five-suite 3x matrix passed on Testbox tbx_01m3jx5am10xv49bp07664y9an. Final check-changed and direct-route P1 autoreview passed.
Refs #159577
What Problem This Solves
Doctor could start a Gateway that was already stopped when its final service inspection failed, timed out, or could not verify the launcher.
User Impact
An already-stopped Gateway activates only after a positive, current ownership and offline verdict for the current installation. Ambiguous inspection leaves activation skipped and records the reason with
openclaw gateway status --deepguidance. Recovery of a Gateway Doctor itself stopped remains best effort, and update-time Doctor still leaves activation with the updater.Why This Change Was Made
The restoration owner previously retained the earlier ownership verdict after an inconclusive final probe and used its recovery fallback to start the service. It now classifies stopped-service inspection as
owned-offline,not-ours, orinconclusive; only the positive outcome admits activation. Strict ownership revalidation and the canonical platform offline check run before service-config repair and after its second inspection. A contradictory running indicator blocks activation. A service that repair already started still receives health verification.This follows up on ClawSweeper's finding. No configuration, schema, dependency, or timeout changes.
Evidence
repair, startafter failed/timed-out launcher probes, unknown runtime, and unavailable launcher inspection. Post-config-repair controls also reproduced restart on unknown runtime/load state. The fixed controls reject those effects and preserve successful activation/readiness behavior.node scripts/check-changed.mjspassed all selected checks, including core/test typechecks, lint, dead exports, and guards. The final Testbox command exited 0 in 35m34.66s.Testbox run, provider
blacksmith-testbox, leasetbx_01m3jx5am10xv49bp07664y9an. The tested tree ise3879e3ba8f1d32c1ddefd0dfd52ea227e070697.The managed-admission suite also passed three local runs. The heavier settlement sibling hit its existing 120-second per-test limit on this Mac in
readyandstore-close-failed; the remaining heavy repetitions ran on the Testbox. These managed-flow suites already use the release-only runtime tier. A temporary spy-through profile ofclean-repairmeasured 82 content-version child launches plus 6 snapshot launches consuming 16.5 of 26.9 test seconds. The synchronous SQLite freshness-reader cost remains a performance follow-up; the remote passes are additional evidence, not a claim that the local timeout was fixed. No retries, larger timeouts, or weaker assertions were added.Production: +121/−48 (net +73); tests/support: +123/−4; docs: +5/−1. Growth covers the closed inspection outcome, shared inspection handling, and both activation gates while retaining Doctor-owned recovery.