fix: accept reformatted launchd service ownership - #149
Conversation
|
🦞👀 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 15, 2026, 11:50 PM ET / September 16, 2026, 03:50 UTC (Revision 5). ClawSweeper reviewWhat this changesParse macOS service ownership from XML or binary plists, document the behavior, add ownership regressions, and repair three test fixtures. Merge readiness⛔ Blocked before merge - 2 items remain The fix remains necessary on main and v0.2.47. No actionable patch defect was found, but the prior native service proof request remains unsatisfied. Priority: P2 Review scores
Verification
How this fits togetherOCM manages background OpenClaw services through launchd on macOS. Its ownership check compares the service definition’s store with the requesting store before allowing service changes. flowchart TD
A[Service command] --> B[Requesting OCM store]
C[LaunchAgent plist] --> D[Parse environment dictionary]
B --> E{Store matches?}
D --> E
E -->|Yes| F[Allow service operation]
E -->|No or invalid| G[Reject operation]
Before merge
Agent review detailsSecurityNone. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Retain the shared structural parser and exact store comparison, with native acceptance evidence covering existing reformatted services and foreign-store refusal. Do we have a high-confidence way to reproduce the issue? Yes, from source: changing indentation before the generated owner string defeats main’s exact substring check despite preserving the store value. This review did not execute the regression. Is this the best way to solve the issue? Yes. Reading the existing ownership field structurally in the shared helper repairs the serialization dependency without adding a competing ownership mechanism. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b7e2802d9ae0. LabelsLabel 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 (4 earlier review cycles)
|
Parse the store owner from the plist environment dictionary, including binary definitions, while preserving foreign-store rejection and systemd compatibility. Adapt the fix to the current shared inspection and lifecycle ownership helper. Co-authored-by: Vitor Cepeda Lopes <7040636+TheAngryPit@users.noreply.github.com>
268df51 to
faea648
Compare
Closes #147.
What Problem This Solves
Editing an OCM LaunchAgent with PlistBuddy can change XML formatting without changing its store. OCM then incorrectly refuses service lifecycle commands as belonging to a different store.
User Impact
Same-store XML and binary plists remain manageable after reformatting. Foreign, missing, malformed, and incorrectly typed owners still fail closed. Systemd ownership behavior is preserved.
Why This Change Was Made
Read
EnvironmentVariables.OCM_HOMEas a plist value. The current-main adaptation puts this in the shared ownership helper used by service inspection and lifecycle operations. The parser supports Rust 1.88; the lockfile adds only plist and quick-xml. Includes the contributor's parser controls, a CLI regression, usage documentation, and a changelog credit to @TheAngryPit.Evidence
The new CLI regression first failed on unchanged main with the different-store error after an indentation-only edit. It now passes through fresh service setup, native macOS PlistBuddy reserialization, same-store start, foreign-store refusal without rewriting the definition, and owner stop. Service-manager calls use the repository's isolated synthetic fixtures; no installed service was modified. Parser tests also cover binary plists, escaped paths, comment decoys, missing/wrongly typed owners, and malformed input.
The same regression also passes against the optimized binary produced by
cargo install --locked --path .into an isolated prefix. Formatting, all-target checking, parser controls, and independent P0–P2 review pass. Python release-boundary (33) and npm (21) tests pass with native gh scoped to their loopback fixture transport. Full Rust and exact-head CI results will be recorded after completion. Native launchd bootstrap on an installed service was not exercised; the CLI and native plist serializer were exercised against synthetic definitions.The full gate exposed three existing fixture problems, repaired without changing production behavior: wait for a resumed child marker before terminating it, keep rollback HTTP health available until teardown, and copy the npm executable fixture when the build and temp directories are on different filesystems.
Broad validation on an isolated Linux runner covers the full Rust suite: the full run passed unaffected targets, and a clean rebuild passed all 96 tests in the three npm-fixture targets after fixing the cross-filesystem fixture. The shared Mac's broad run also exposed lifecycle timing failures; the changed ownership path and installed-release regression pass natively. Final committed-patch review is clean at P0–P2. Exact-head GitHub CI remains the merge gate.
All nine cross-platform CI jobs passed at
faea648f2a55a1dbf6b92f4a2d9eb19e307a6a13: https://github.com/openclaw/ocm/actions/runs/35052552513.