Repository navigation
refactor(daemon): consolidate system ownership formatting - #135283
vincentkoc wants to merge 1 commit into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 12:06 PM ET / 16:06 UTC. ClawSweeper reviewWhat this changesThe PR centralizes POSIX shell quoting and sanitized ownership-error formatting used by launchd, systemd, service inspection, and service-layout output. Merge readinessNo introduced correctness or security defect was found: the PR extracts byte-equivalent daemon formatting policy into one private module. It is MEMBER-authored and carries the protected Priority: P3 Review scores
Verification
How this fits togetherGateway service setup checks whether an operating-system service already owns the Gateway before changing user-level service files. The reviewed helpers format safe recovery commands and bounded diagnostics for operators. flowchart LR
A[Service metadata] --> B[Ownership detection]
C[Filesystem and service errors] --> B
B --> D[Shared formatting]
D --> E[Safe shell commands]
D --> F[Recovery diagnostics]
E --> G[Operator action]
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource -12. Total -12 across 5 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep one private daemon-owned formatter for the repeated policy and land the refactor through the normal draft-review path. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR refactors existing formatting behavior rather than reporting a user-facing defect. Is this the best way to solve the issue? Yes: a single private daemon leaf module removes repeated policy while preserving the existing callers and ownership boundaries. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1b236dfc8625. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Closing under the current refactor sponsorship policy. This is a behavior-neutral refactor with no linked active fix or deliverable and no durable human-maintainer sponsorship for this exact objective. The objective is retired from the current portfolio; current main has not absorbed this patch. Reopen or reconstruct only when a maintainer ties this exact refactor to a concrete active fix or deliverable. Open #133215 touches separate daemon logic and does not depend on this extraction. |
What Problem This Solves
Resolves duplicated daemon-owned formatting policy for POSIX shell arguments and bounded system-ownership failure details. The copies spanned launchd, systemd, cleanup hints, and service layout output, creating avoidable drift risk.
Why This Change Was Made
One private daemon leaf module now owns the existing shell-quoting and failure-detail formatting contracts. Launchd, systemd, inspection, and service-layout callers reuse it without changing Windows behavior, public APIs, SDK surfaces, dependencies, or persistence.
User Impact
No user-visible behavior changes. Operator-pasteable commands and system-ownership diagnostics retain their existing quoting, sanitization, truncation, and recovery text.
Evidence
pnpm check:import-cycles: 0 runtime value cycles.pnpm check:madge-import-cycles: 0 cycles.pnpm buildcompleted compilation and artifact generation, then the shared checkout's linked@openclaw/aiartifact failed runtime postbuild because it predated a current diagnostics export. Re-running the exact native-require verifier against the freshly built task-local package passed all 53 built plugin control-plane modules and doctor closures.gpt-5.6-solat high reasoning: scoped clean, no accepted or actionable findings, correctness confidence 0.99.ae24725490eed59d55c290a42b33c6d1081791b5andef44eab5ed8320cd5a5f34d790cedceffaefc36f; neither changed the affected daemon paths. Open PRs fix(systemd): stop leaking live gateway tokens through readable .service.bak files #131786 and fix(daemon): install gateway LaunchAgent on boot volume #133215 touch separateinspect.tsregions.