Repository navigation
fix(doctor): report remaining systemd units after cleanup - #158034
Conversation
The confirmed unit's disable result does not establish that no other canonical or legacy user unit remains. Consult the existing scoped installation discovery passively after cleanup and report remaining or unverifiable state without deleting another unit. Keep the successful removal distinct from a later inspection failure, and limit clean wording to the supported matching installed-unit search. Add causal Doctor-boundary regressions for a surviving alias and failed post-cleanup inspection. Native transport and uninstall are mocked; the selected synthetic file is actually removed and legacy bytes stay intact. Follow-up to #119674.
|
🦞👀 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: blocked before merge. Reviewed September 25, 2026, 11:31 AM ET / 15:31 UTC (Revision 6). ClawSweeper reviewWhat this changesThe branch makes Doctor report surviving Linux user units after confirmed cleanup and carries related service, provider-discovery, and test changes. Merge readiness⛔ Blocked before merge - 4 items remain Current main still claims the system unit is the sole Gateway manager after removing one user unit. This PR addresses that reporting error while keeping removal bound to the confirmed unit. Its earlier provider-catalog compatibility concern no longer applies to the current branch. Priority: P2 Review scores
Verification
How this fits togetherOn Linux, Doctor reads systemd service identities before offering to remove a duplicate user unit. The proposed change reads service state again after that removal and reports what remains. flowchart LR
A[Selected profile] --> B[Systemd unit discovery]
B --> C[Identity and ownership check]
C --> D[Operator confirmation]
D --> E[Confirmed unit removal]
E --> F[Read remaining units]
F --> G[Doctor result]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +23, Tests +202, Docs +3. Total +228 across 12 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep removal limited to the confirmed unit, then report a surviving scoped user unit or an unverifiable inspection without claiming global service exclusivity. Do we have a high-confidence way to reproduce the issue? Yes, at the source and synthetic Doctor boundary: current main makes the sole-manager claim after one selected removal, and the PR supplies two cases with a surviving alias. I did not execute the cases or a live systemd run. Is this the best way to solve the issue? Yes. Reusing scoped discovery after the existing confirmed removal is a narrow repair that adds no deletion authority. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d058e5d8c401. LabelsLabel changes:
Label justifications:
EvidenceWhat 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)
|
|
Data-model disposition for The regression actually removes the selected synthetic file, verifies the surviving alias's bytes remain identical, and checks that a failed follow-up read is reported separately from successful cleanup. The published updater's existing in-progress marker still defers service repair before this branch, as the review also verifies. The prior documented no-dueling updater flow likewise exits before it. The path-based Doctor/repair classification therefore does not identify a new stored-data contract needing migration proof here. No new live-systemd or rebuilt-package result is claimed; the 155 focused cases, full changed-file checks, and managed review support this reporting-only correction. Normal CI and merge gates remain required. |
|
Hosted CI 36117727204 completed with one failed test job plus its aggregate gate. The failure is in the unchanged config-preflight cohort: job 108017066985, The tested merge was No unchanged-head rerun or auto-merge request was submitted. The alias-reporting source remains at the reviewed |
Reuse the canonical startup pending-read correction while preserving selected-unit reporting and cleanup scope. (cherry picked from commit 9b90a98)
Restore the task-created catalog changes to fixed canonical main168d454d while preserving scoped outcome handling from #158139 and the real HTTP fixture correction from #158115. Keep the service-reporting repair and canonical pending-read assertions unchanged. The previous inference changes introduced a compatibility and native augmentation regression. Their failure history remains documented; the separate legacy-retention repair is not a dependency of this feature.
|
Maintainer disposition for current head The inferred-ready catalog design reviewed on the earlier head has been withdrawn. Provider configuration alone is no longer promoted to a live outcome, and the catalog paths match fixed canonical main The earlier merge conflict is resolved with the exact landed #158074 mock-lifetime cleanup; every reader, staging, and settlement assertion remains. GitHub reports the current head mergeable. The original systemd mutation/identity/update owners are unchanged. The earlier source-backed update/data-contract disposition still applies: this is scoped completion reporting after one confirmed removal, not a new stored-data format or broader cleanup operation. The regression proof uses synthetic unit files with mocked native transport/uninstall; no new installed-package or live-systemd proof is claimed. After withdrawal, 100 direct catalog/auth/scope cases pass, including the unchanged native-worker assertion that failed on the detour. Selected checks and fresh managed P2 review pass. The local freshness runtime-build refusal remains explicitly unrun; its landed qualification and current-head hosted CI provide that coverage. CI 36153767777 must pass the normal landing gate. Earlier failed runs remain recorded and were not rerun unchanged. |
|
Merged via squash auto-merge.
|
…58034) * fix(doctor): report remaining systemd units after cleanup The confirmed unit's disable result does not establish that no other canonical or legacy user unit remains. Consult the existing scoped installation discovery passively after cleanup and report remaining or unverifiable state without deleting another unit. Keep the successful removal distinct from a later inspection failure, and limit clean wording to the supported matching installed-unit search. Add causal Doctor-boundary regressions for a surviving alias and failed post-cleanup inspection. Native transport and uninstall are mocked; the selected synthetic file is actually removed and legacy bytes stay intact. Follow-up to openclaw#119674. * test(doctor): distinguish readers from staging workers Reuse the canonical startup pending-read correction while preserving selected-unit reporting and cleanup scope. (cherry picked from commit 9b90a98) * fix(models): integrate canonical discovery provenance repair Compose the qualified catalog correction from openclaw#158113, including explicit static and advisory outcomes and exact auth-provenance expectations. Include its existing first-discovery retention prerequisite; preserve the independent Doctor reporting change. Canonical commits: aef8743, 5d9c2d7, 3cb4c86. * fix(ci): finish canonical catalog and Doctor integration Preserve the landed Doctor mock lifetime cleanup while composing the catalog loader type leaf and generated non-live catalog outcome correction. Reader and staging assertions, strict live discovery, and custom callbacks remain unchanged. Canonical commits: a9db992, 9adf333, 4f1acb7. * fix(ci): withdraw catalog inference detour Restore the task-created catalog changes to fixed canonical main168d454d while preserving scoped outcome handling from openclaw#158139 and the real HTTP fixture correction from openclaw#158115. Keep the service-reporting repair and canonical pending-read assertions unchanged. The previous inference changes introduced a compatibility and native augmentation regression. Their failure history remains documented; the separate legacy-retention repair is not a dependency of this feature.
What Problem This Solves
Doctor could remove the confirmed user-scope systemd unit and claim the system service was the sole Gateway manager while another canonical or legacy user unit remained installed.
User Impact
Doctor reports a remaining matching user unit or an unverifiable follow-up and gives inspection/rerun guidance. It still removes only the unit the operator confirmed. Additional units require separate inspection and confirmation.
Why This Change Was Made
An uninstall result describes one selected unit, not every possible manager. After successful selected-unit cleanup, Doctor passively consults the existing profile/selector-scoped discovery owner. A clean result says only that no other matching installed user unit was found; it does not claim global exclusivity or service health. A later inspection failure does not turn successful removal into a removal error.
This follows #119674 and preserves its installation identity, confirmation, update admission, and uninstall operation. The published updater's in-progress policy defers this service-repair path. No configuration, schema, persisted format, or deletion authority changes are introduced.
The temporary catalog-inference changes imported during CI repair have been withdrawn, not accepted. Catalog files now match fixed canonical main
168d454d, retaining the landed scoped-outcome correction #158139 and real-HTTP fixture correction #158115. Returned provider configuration alone is not promoted to a live discovery outcome. The separate legacy-retention repair is not a prerequisite for this PR.Evidence
Two regression controls failed on the original false “sole gateway manager” report after deleting the selected synthetic unit while the second alias's bytes remained intact. The corrected service path passed 18 identity cases, 130 Doctor siblings, and seven selected-unit removal cases: 155 distinct cases. Native transport and uninstall are mocked at that boundary; this is not a new live-systemd or published-package claim.
The pending-read fixture uses the landed reader/staging attribution correction from #145043 and mock-lifetime cleanup from #158074. All five cases pass with reader reuse, balanced staging, and natural child-settlement assertions unchanged.
After withdrawing catalog inference, 100 direct composition cases pass, including the unchanged native-catalog worker assertion, the real HTTP discovery lifecycle, auth provenance, and explicit alias-scoped outcomes. Selected core and test type graphs, lint, formatting, line-cap checks, and the full all-import cycle check passed. Fresh managed P2 review of the reversal is clean. The original service review and applicable proof are retained.
The local five-file invocation stopped before any Vitest case because the freshness fixture requires a runtime build and its publication guard could not establish the affected Gateway's offline/disjoint state. No operator Gateway was stopped, no guard was bypassed, and no freshness pass is claimed for that invocation. The exact landed #158115 fixture has its own standalone, contended, and original-shard qualification; current-head hosted CI remains the landing gate.
Historical failures remain recorded: 36117727204 exposed the reader/staging fixture; 36130205590 exposed missing explicit success in the HTTP discovery fixture; 36147791257 exposed the withdrawn inference's native augmentation regression. Failed heads were not rerun unchanged, and no merge request was submitted against them.
A separate historical macOS Canvas control had 298/300 passing cases in its original group and 7/10 alone, with timeout, stale-config, and coordinator-scope failures. Their cause remains unproved. Those logs and the limitation are retained; no Canvas assertions or deadlines were changed.