Repository navigation
Conversation
|
Codex review: blocked before merge. Reviewed September 25, 2026, 3:07 AM ET / 07:07 UTC (Revision 23). ClawSweeper reviewWhat this changesThe branch makes Linux Gateway status, service controls, and Doctor select systemd units by profile and inspected service identity, supports legacy and custom unit names, and binds duplicate cleanup to the unit the operator confirmed. Merge readiness⛔ Blocked before merge - 4 items remain Current main still has the fallback that can select an unrelated systemd unit, so this PR remains necessary. The reviewed branch addresses that failure, and the earlier actionable findings are repaired. One upgrade tradeoff still needs explicit maintainer acceptance: an existing default-profile custom unit with an opaque launcher now requires an explicit unit selector. Priority: P1 Review scores
Verification
How this fits togetherOpenClaw’s daemon adapter turns a selected profile and service environment into a systemd unit for Gateway status and lifecycle commands. Doctor uses the same discovery to diagnose competing units and, after confirmation, remove a redundant user unit. flowchart LR
A[Selected profile and environment] --> B[Systemd unit discovery]
C[User and system unit files] --> B
B --> D{Identity verified?}
D -->|Yes| E[Selected unit]
D -->|No| F[Refusal or explicit selector guidance]
E --> G[Gateway status and controls]
E --> H[Doctor confirmation and cleanup]
Decision needed
Why: The prior marker-first behavior could select another profile’s unit, while safe automatic ownership cannot be established from an opaque launcher. Choosing that compatibility boundary requires maintainer intent. Before merge
Agent review detailsSecurityNone. PR surfaceSource +468, Tests +1191, Docs +4. Total +1663 across 27 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep profile-safe discovery and the explicit-selector escape hatch, make the recovery command clear at the refusal point, and land after the service owner accepts the opaque-wrapper upgrade tradeoff. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source still selects the first marker-owned system unit when the expected profile unit is missing, matching the reported multi-profile wrong-service path; this read-only review did not execute it. Is this the best way to solve the issue? Yes for the reported misrouting: selection now follows the profile and the inspected unit through its callers. The opaque-wrapper upgrade behavior remains a maintainer compatibility choice. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 04fb3c8e35b3. LabelsLabel changes: No label 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 (22 earlier review cycles; latest 8 shown)
|
994dfc7 to
5b5b8a5
Compare
|
@clawsweeper re-review Addressed Claw P1: OPENCLAW_SYSTEMD_UNIT is honored again for installed unit discovery (Node openclaw-node and custom units), while profile isolation still refuses unrelated profile units. Head after push includes focused discovery coverage for the override paths. |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
@clawsweeper re-review Prior re-review ack for head fa2217e still shows "picked this up" without a durable review. P1 fix is on head: OPENCLAW_SYSTEMD_UNIT is honored for installed unit discovery (Node openclaw-node / custom), while profile isolation still refuses unrelated profile units. Focused discovery tests cover the override paths. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Addressed Claw default-profile P1: marker-owned system unit discovery is candidate-only for every profile, including default. Unrelated named-profile units (e.g. openclaw-darlene) and arbitrary custom units are no longer adopted when the default gateway unit is absent. Bare openclaw remains a known default legacy name; custom units still use OPENCLAW_SYSTEMD_UNIT. Added regression tests for default-versus-named isolation. |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
@clawsweeper re-review Head is now f49cd29 (after default-profile candidate-only fix). Prior re-review ack did not produce a durable review on this head. Please re-review: marker scan is candidate-only for every profile including default; regressions cover default vs openclaw-darlene and arbitrary custom units. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Updated the PR body with stronger real behavior proof on the current head. Refreshed ## Evidence and ## Real behavior proof with exact-head production boundary output: resolveGatewaySystemdServiceNameCandidates + findInstalledSystemdGatewayScope against real temp unit files (profile isolation, OPENCLAW_SYSTEMD_UNIT, legacy default). No Linux systemctl multi-unit lab in this pass. Local check-proof.mjs: PR context PASS. |
f49cd29 to
75941a3
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Keep over-cap doctor and systemd suites from growing. The confirmed-unit refusal still lives next to other systemd cleanup coverage. Signed-off-by: Sebastien Tardif <[email protected]>
Move maybeResolveDuelingSystemdGatewayScopes to a sibling module so the line-cap ratchet does not treat the confirmed-unit target as growth. Signed-off-by: Sebastien Tardif <[email protected]>
Integrate the reviewed service identity repair with the fixed main base. Inspect custom system units through the existing effective service owner, preserve unrelated profiles and ambiguous-selection refusals, and retain one inspection deadline through discovery and status. Co-authored-by: Sebastien Tardif <[email protected]>
Keep load-state inspection below the platform service facade and share its existing isLoaded capability from the service types owner. This removes the all-import cycle while preserving default arguments, refusal handling, and both caller flows. Co-authored-by: Sebastien Tardif <[email protected]>
Integrate fixed main54 while retaining profile-scoped discovery and custom system-unit preservation. Carry the discovered user unit into peer admission and definition inspection without changing the operation's original selector or weakening its retargeting checks. Recognize current and legacy names for the same profile as competing user/system managers. Co-authored-by: Sebastien Tardif <[email protected]>
Carry fixed main 6f60b82 with the joined database-drain repair from openclaw#157631. The existing service identity patch is unchanged. Reuse the canonical type-only npm-pack import correction from openclaw#157659 so the composed core graph typechecks. Co-authored-by: Sebastien Tardif <[email protected]> Co-authored-by: Jason (Json) <[email protected]>
Initialize the registry before Gateway startup so reset cannot close the captured shared-state source. Reload later task fixtures through the existing async owner and retain main's persisted-task assertions. Preserve page, visibility, timing, and cleanup expectations. The earlier CI empty-page result did not reproduce in the unmodified local test; this fixes the verified fixture lifetime violation without weakening production guards.
Compare both loaded commands' actual profile, home, state/config paths, and port before treating known user/system unit names as a duplicate installation. Retain account inspection and recheck ownership after operator confirmation. Reuse the existing Gateway environment-port parser for Compose host:port values. Preserve default custom-unit discovery and its legacy configuration contract. Integrate fixed main 7338f79. Co-authored-by: Sebastien Tardif <[email protected]>
Carry fixed main 3e63b56 after attributed CI failures. Preserve the reviewed service repair byte-for-byte; consume the canonical cancellation publication, config watcher, archive, QA fork, additive-schema fixture, and import-cycle repairs. The earlier task-cursor timing failure remains unexplained; this integration does not weaken cursor, page-count, latency, or authority assertions. Co-authored-by: Sebastien Tardif <[email protected]>
|
Maintainer decision for I verified the refusal in The Doctor-path classification does not introduce a persisted-format or schema change. The PR's data-model section records the unchanged published 2026.9.5 updater's migration/finalization and custom-unit recovery evidence on the exact ancestor package, including the operator-stop/start boundary and peer retention. It does not claim a rebuilt final package. The current composition has its separate passing 621-test integration run, complete changed-file checks, and full-import Madge result; current-head CI remains required. |
|
Merged via squash.
|
* 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 #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 #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, 36def8b. * 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: cbff337, 9adf333, 4f1acb7. * fix(ci): withdraw catalog inference detour 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.
…nclaw#119674) * fix(daemon): scope systemd unit resolution to the active profile Doctor on multi-agent Linux hosts must not adopt the first openclaw marker unit. Probe current plus legacy names for the active profile, and honor OPENCLAW_SYSTEMD_UNIT for Node and custom units. Closes openclaw#119648 Replayed onto origin/main cfcc681. Signed-off-by: Sebastien Tardif <[email protected]> * fix(daemon): reject colliding systemd legacy names and carry selected unit Drop legacy candidates that identify Node or another profile gateway. Pass the discovered unit into ownership checks, command inspection, and duplicate cleanup so start/restart cannot target the wrong service. Signed-off-by: Sebastien Tardif <[email protected]> * fix(daemon): keep default-profile systemd template identity Accept [email protected] and [email protected] as instances of the legacy openclaw candidate so marker lookup still finds main's system templates. Named-profile units stay candidate-exact. Signed-off-by: Sebastien Tardif <[email protected]> * test(daemon): extract systemd identity coverage from over-cap file Move profile-identity cases out of systemd.test.ts so the line-cap ratchet does not grow the grandfathered file. Signed-off-by: Sebastien Tardif <[email protected]> * test(daemon): settle extra systemd probes in identity ownership case The extracted ownership test used a one-shot execFile mock. Compact CI called systemctl again before the ownership check and failed closed. Signed-off-by: Sebastien Tardif <[email protected]> * test(daemon): keep exec-backed identity cases on the systemd mock Discovery-only profile cases stay in systemd-scope.identity.test.ts. Lifecycle inspect/uninstall/ownership stay in systemd.test.ts so compact shards do not hit a real user bus. Parser cases move to systemd-unit.test.ts. Signed-off-by: Sebastien Tardif <[email protected]> * ci: retrigger after compact-large sessions-reset flake Signed-off-by: Sebastien Tardif <[email protected]> * fix(daemon): keep explicit systemd template instance selection [email protected] with only [email protected] installed now resolves the backing template while keeping the requested instance for inspection and control. Signed-off-by: Sebastien Tardif <[email protected]> * fix(daemon): keep doctor systemd cleanup on the confirmed unit Doctor confirmation names the inspected user unit. If that file disappears before removal, do not fall back to a leftover legacy unit such as openclaw-lisa.service. Signed-off-by: Sebastien Tardif <[email protected]> * test(daemon): move systemd cleanup target-change cases to a sibling file Keep over-cap doctor and systemd suites from growing. The confirmed-unit refusal still lives next to other systemd cleanup coverage. Signed-off-by: Sebastien Tardif <[email protected]> * refactor(doctor): extract dueling systemd cleanup from the over-cap file Move maybeResolveDuelingSystemdGatewayScopes to a sibling module so the line-cap ratchet does not treat the confirmed-unit target as growth. Signed-off-by: Sebastien Tardif <[email protected]> * fix(daemon): isolate service load-state inspection contracts Keep load-state inspection below the platform service facade and share its existing isLoaded capability from the service types owner. This removes the all-import cycle while preserving default arguments, refusal handling, and both caller flows. Co-authored-by: Sebastien Tardif <[email protected]> * test(daemon): track legacy unit fixture cleanup * test(gateway): preserve task fixture database lifetime Initialize the registry before Gateway startup so reset cannot close the captured shared-state source. Reload later task fixtures through the existing async owner and retain main's persisted-task assertions. Preserve page, visibility, timing, and cleanup expectations. The earlier CI empty-page result did not reproduce in the unmodified local test; this fixes the verified fixture lifetime violation without weakening production guards. --------- Signed-off-by: Sebastien Tardif <[email protected]> Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Jason (Json) <[email protected]> Co-authored-by: Sebastien Tardif <[email protected]>
…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
Systemd discovery could report another profile's Gateway as the selected service, and Doctor cleanup could act on a different unit after the originally inspected unit disappeared. Restricting discovery to conventional filenames alone would also lose existing default-profile installations that use arbitrary custom system-unit names.
User Impact
Status and Doctor inspect the selected profile, preserve existing default-profile custom system units, and keep cleanup attached to the unit the operator confirmed. Strict reads of a legacy user unit retain its actual identity; current and legacy names remain candidates for competing managers, with effective identity checked before duplicate cleanup.
Why This Change Was Made
This change keeps canonical, legacy, and explicit unit selection scoped to the requested identity. When no user unit or explicit selector takes precedence, default-profile discovery uses the existing effective-command inspector to recognize a custom Gateway system unit. The inspected service's own command and environment determine its identity; the invoking process cannot manufacture a match. Named-profile, foreign-state, foreign-account, and Node services are excluded, and multiple matching custom units remain an ambiguity error.
Command inspection, lifecycle ownership checks, and Doctor cleanup consume the selected unit. Cleanup remains bound to the confirmed user unit. Doctor checks both loaded commands against the selected profile, home, state/config paths, and port, then rechecks the units and the system unit’s active/enabled state after confirmation. Different or unverifiable identities preserve the user unit.
OPENCLAW_SYSTEMD_UNITcontinues to select custom units explicitly, including template-backed instances. An opaque wrapper still requires an explicit selector.Thanks to @SebTardif (Sebastien Tardif) for the original fix and systemd behavior coverage.
Closes #119648.
Evidence
The current signed head is
023c23f3579bae93453aaf30916cf93ab202f067(tree9ace1aa883d720528cdb6b561181d802fb1fac7a). It incorporates fixed main3e63b56ed82e34bf1ee90da6ae56e994f57ec011to consume the canonical repairs for its failed CI gates. The merge has no overlapping feature paths; all 27 feature files retain their reviewedb8adbe24bytes. The task-owned dependency installation was reconciled with the incoming main lockfile using the normal frozen install.A fresh review exposed an additional duplicate-cleanup defect: conventional or legacy filenames could reach removal even when the effective system unit belonged to another account, profile, state/config, or port. The real Doctor entrypoint reproduced ten unsafe uninstall requests, while five valid controls passed. The correction passed 388 service/Doctor tests. A supported Compose-style environment-port case then reproduced a compatibility gap; reusing the existing Gateway parser fixed it, with all 56 config-path tests and 16 Doctor identity cases passing. Native transport and the final uninstall boundary are mocked in these tests; they are not a new live systemd claim. The 16-case Doctor regression cost is 354 ms in test bodies and 30.22 seconds wrapper wall with
pnpm test src/commands/doctor-gateway-dueling.identity.test.ts --maxWorkers=1; import transformation dominates, and the fixture adds no Gateway boot or real-time polling.The composed source passed 621 focused tests across six maintained Vitest shards (365.71 seconds wrapper wall), including both original task-pagination cases and both real queued-collector exact modes. Full-import Madge reports zero cycles. The complete maintained changed-file checks passed, including core typing, all 25 core-test type graphs, formatting, scoped lint, export scans, ratchets, and all selected guards. Independent P2 review of the feature is complete with no accepted actionable finding remaining; a separate source review found no integration defect in the incoming service and CLI changes. The established OS-account-bound default-install and legacy-config behavior is preserved. The former two full-import cycles were fixed canonically in
818b0092; the earlier runtime-only cycle pass was not substituted for that failed full-import gate.The real Linux systemd upgrade payload passed on ancestor
aa5759da1a15b1821dcac7a4ac3c87ef4bd06b2d(treed22262757de6174fa4dffd66d9d185a82693011b): provider exit 0 and returned native, service-cell, and slice receipts each recordedsuccess: true. The allocation workflow ended cancelled during cleanup and is not claimed green. All task-owned services, account, and lease were cleaned up. Evidence archive SHA-256:08d8711460e7200f6ba080059349e3740978ff11ba9f9ce516132f10008777ba; candidate package SHA-256:88cb392760536493f4b21dbb7f1673a98835e69bc50fdbc4b7435eb8a20f3ad3.That package proof remains attributed to its exact ancestor. The subsequent load-state move had a bounded in-memory ESM-equivalence check, not whole-bundle or initialization-order proof. The fixed-main integration and new user-unit corrections have their own source tests and review; no rebuilt final package is implied.
Published updater proof
The successful cell used the unchanged published 2026.9.5 updater and a locally packaged candidate. This is an operator-controlled downtime flow:
update --yes --no-restart --tag <candidate.tgz> --json. It exits successfully, installs the distinct candidate build, and completes migration. All 12,772 regular candidate package files match the archive; the lifecycle marker is verified separately as consumed by installation. The default service stays stopped and the peer stays unchanged.gateway restart --jsonrefuses before mutation and names the exactsudo systemctl restart <custom-unit>command.The proof did not inject a selector or modify the published updater. Published 2026.9.5's fallback uses the first marker-owned unit; the fixture recorded its actual selection. Semantic peer exclusion is a candidate behavior claim.
Data model compatibility
This patch changes service discovery and repair targeting, not a storage schema or persisted configuration format. Existing service unit names, profiles, and state locations remain the inputs. At the recorded
aa5759ancestor, the unchanged published 2026.9.5 updater exercised that candidate's existing migrations and finalization against the synthetic installed state; the default Gateway then started from that state and the peer continued running throughout.Sanitized fields from the actual returned updater and fixture receipts:
The updater recorded configuration normalization and its pre-update backup. The fixture verified unchanged authored unit bytes and peer process identity; it did not assert that migrated configuration bytes were unchanged or exercise an exhaustive historical session-data corpus.
Compatibility limits and retained observations
--no-restartattempt reached candidate migration but encountered the running default Gateway's lifecycle coordinator. The updater rolled the package back and restored readiness; both service PIDs, invocations, and unit bytes remained unchanged. The positive cell above therefore explicitly stops the default service before updating.The native cell used Node 24.19.0; local targeted checks used Node 24.21.0. No live operator configuration, credentials, or services were used.
The earlier
aa5759CI run 36004101271 reported the full-import daemon dependency cycle corrected above and a separate Codex shared-client lifetime assertion. The runtime-only import-cycle pass did not establish that the full-import gate passed; that earlier correction had its own passing full-import check. The separate Codex assertion is not claimed fixed here, and neither failed job was rerun unchanged.The prior
a2a4cc49CI run 36055307651 failed when recreating an agent database after deletion. Its accepted auto-merge request was retired before replacing the head. The canonical fix landed in #157631, whose Gateway proof and this candidate’s two local Gateway cases pass. The original failed head was not rerun unchanged. Current-head CI remains the landing gate.A later CI run 36074193357 reported an empty restricted task page in the Gateway performance fixture. The unmodified local file passed, so the exact CI cause is not established. The
00ce9b65test-only follow-up adopted the existing fixture-owner correction: reset the task registry before Gateway startup, then reload live task fixtures through the captured-source async owner rather than closing shared state. All page, visibility, timing, and persisted-task assertions remain. Both helper consumers pass (3 tests), along with Gateway test typing, lint, formatting, ratchets, and scoped-clean P2 review. Production authorization and service behavior are unchanged.The
00ce9b65CI run 36076521530 later rejected the third task page after chat settled. The exact failed merge was replayed with the original four-plan job, compiler inputs, and worker count; both four-CPU and two-CPU diagnostic runs passed 4,286 tests each. A separate held-chat timing control also preserved the cursor. The diagnostic instrumentation can affect timing, and the original cause remains unproved. No cursor validity, count, latency, or retry assertion was weakened. The current service correction is a separate causally demonstrated fix, not a claimed repair of that intermittent CI result.The
b8adbe24CI run 36090908792 completed with five failures: raw-DDL rationale placement, an additive-schema index fixture, the QA native-fork route, queued-collector cancellation publication, and config publication after a delayed watcher echo. This fixed-main integration includes their canonical repairs (af545bf3,cb3e6df6,63d299c3,d65bc76d, and #157906), plus the archive bootstrap correctiona759f770. The cancellation repair protects the matching cleanup/publication invariant and retains the real exact-mode test; the original CI race was not independently captured here. The closed alternative #157927 was not layered into this branch. No failed-head job was rerun unchanged.