Repository navigation
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 27, 2026, 2:10 PM ET / 18:10 UTC. Summary PR surface: Source +123, Tests +196. Total +319 across 6 files. Reproducibility: yes. The linked issue has concrete live headless macOS evidence, and current main source still writes and bootstraps only the gui-domain LaunchAgent without a same-label system-domain guard; I did not rerun a live macOS LaunchDaemon scenario in this read-only review. Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the narrow duplicate-manager guard after redacted live macOS launchd proof confirms same-label system LaunchDaemon cases are blocked before user LaunchAgent mutation, while keeping broader system LaunchDaemon lifecycle work in the open companion issue. Do we have a high-confidence way to reproduce the issue? Yes. The linked issue has concrete live headless macOS evidence, and current main source still writes and bootstraps only the gui-domain LaunchAgent without a same-label system-domain guard; I did not rerun a live macOS LaunchDaemon scenario in this read-only review. Is this the best way to solve the issue? Yes, with one proof gap. A pre-write and pre-kickstart conflict guard is the narrowest maintainable fix for this duplicate-manager bug; full system LaunchDaemon lifecycle management should remain with the broader companion issue. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 98ed83f848de. Label changesLabel justifications:
Evidence reviewedPR surface: Source +123, Tests +196. Total +319 across 6 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Closing this in favor of #97285, which now owns the same #97178 duplicate-launchd-manager fix with the stronger proof and current readiness. Both branches guard LaunchAgent install, restart, bootstrap repair, and update recovery against a same-label system LaunchDaemon. #97285 additionally covers the doctor repair surface, has redacted after-fix proof against a real root-owned macOS LaunchDaemon plus a current-main negative control, and its exact head Thank you for the thorough launchd guard and regression coverage, @LiLan0125. |
Closes #97178
What Problem This Solves
Fixes an issue where macOS users installing or restarting the Gateway as a user LaunchAgent could end up with duplicate OpenClaw services when an operator-managed system LaunchDaemon already uses the same launchd label.
Why This Change Was Made
The LaunchAgent lifecycle now checks the system launchd domain before installing, repairing, bootstrapping, or restarting the user service, including the normal restart kickstart path. It detects both loaded
system/<label>services and system LaunchDaemon plist files whoseLabelkey matches the user LaunchAgent label, then surfaces the conflict through install, recovery, and update flows instead of silently proceeding.User Impact
macOS users get an explicit error that tells them to remove, rename, or choose a different label for the system LaunchDaemon before OpenClaw creates or restarts a user LaunchAgent with the same identity. This prevents duplicate gateway services and restart loops across launchd domains.
Evidence
node scripts/run-vitest.mjs run src/daemon/launchd.test.tspassed 1 Vitest shard in 13.62s.node scripts/run-vitest.mjs run src/daemon/launchd.test.ts src/cli/daemon-cli/launchd-recovery.test.ts src/cli/update-cli/update-command.test.tspassed 2 Vitest shards in 23.07s.git diff --checkpassed.installLaunchAgentandrestartLaunchAgentimplementations fromsrc/daemon/launchd.ts.Real behavior proof
Behavior addressed: Gateway LaunchAgent install and restart refuse to create or restart a user-domain service when launchd already has
system/ai.openclaw.gateway.Environment tested: Local source checkout on Linux with Node and a temporary
launchctlexecutable onPATHthat reportssystem/ai.openclaw.gatewayas loaded.Steps run after the patch: Called the actual
installLaunchAgent,restartLaunchAgent, andresolveLaunchAgentPlistPathexports fromsrc/daemon/launchd.tsvianode --import tsx --no-warnings -e, with a temporary HOME andlaunchctlcommand log.Evidence after fix:
Observed result after the fix: Both install and restart reject the same-label system LaunchDaemon before writing the user plist or running
launchctl kickstart.Not tested: A live macOS LaunchDaemon removal/rename flow and a real GUI LaunchAgent session were not exercised in this Linux checkout.