Repository navigation
refactor: split systemd into concept modules - #122002
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 11, 2026, 7:02 AM ET / 11:02 UTC. ClawSweeper reviewWhat this changesThis PR splits Linux systemd gateway-service logic into focused daemon modules while preserving the existing Merge readinessKeep open. Current main still has the monolithic systemd module, while this branch preserves its complete public facade and separates the existing service ownership boundaries without a concrete regression found. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw’s daemon service layer installs, controls, and inspects Linux systemd units that keep the Gateway running. CLI, Doctor, setup, and service-audit flows consume this layer for lifecycle actions and status. flowchart LR
CLI[CLI and Doctor flows] --> Facade[Systemd compatibility facade]
Facade --> Install[Installation and service files]
Facade --> Lifecycle[Start stop restart]
Facade --> Runtime[Runtime inspection]
Install --> Systemd[systemd manager]
Lifecycle --> Systemd
Runtime --> Systemd
Systemd --> Gateway[Managed Gateway]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +104, Other -1. Total +103 across 8 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain Do we have a high-confidence way to reproduce the issue? Not applicable: this PR refactors an existing implementation rather than reporting a behavior defect; the existing systemd suite covers the affected service boundary. Is this the best way to solve the issue? Yes. Keeping one stable facade avoids expanding caller imports while the extracted files align execution, install, lifecycle, runtime, scope, and unit-file responsibilities. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 63bba283a675. 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
|
|
Merged via squash.
|
What Problem This Solves
src/daemon/systemd.tswas a 1,912-line grandfathered file whose size obscured the separate ownership boundaries for generated service files, systemctl execution, installed scopes, runtime inspection, installation, and lifecycle actions.Why This Change Was Made
This splits the implementation along those existing concept seams while keeping
systemd.tsas a pure 32-line compatibility facade for its 27 production and test import sites. The new modules are:systemd-exec.ts— 348 linessystemd-install.ts— 623 linessystemd-lifecycle.ts— 242 linessystemd-runtime.ts— 191 linessystemd-scope.ts— 230 linessystemd-service-files.ts— 350 linesThe generated unit contents, environment-file serialization, systemctl command arguments, ownership checks, dynamic inspection boundary, and public exports are unchanged. The obsolete
systemd.tsmax-lines suppression and baseline entry are removed.User Impact
None. This is a behavior-neutral internal refactor of Linux managed-gateway service ownership.
Evidence
node scripts/run-vitest.mjs src/daemon— 54 files passed; 1,575 tests passed; 10 skipped.pnpm build— passed, with no[INEFFECTIVE_DYNAMIC_IMPORT]diagnostic.node --import tsx scripts/check-export-name-collisions.mts— passed without baseline growth.node --import tsx scripts/check-wrapper-shadowing.mts— passed without baseline growth.node --import tsx scripts/check-import-cycles.ts— 0 runtime value cycles.node --import tsx scripts/check-max-lines-ratchet.mts— passed after removing thesystemd.tsentry.git diff --check— passed..agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main— clean; no accepted/actionable findings.