Repository navigation
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 29, 2026, 1:29 PM ET / 17:29 UTC. ClawSweeper reviewWhat this changesThe branch adds macOS system-LaunchDaemon ownership detection so OpenClaw refuses conflicting user LaunchAgent lifecycle actions and reports an actionable single-owner recovery path. Merge readinessKeep this PR open for maintainer review. It is a well-proven, targeted fix for the duplicate-supervisor restart storm, but it deliberately changes the upgrade behavior of existing macOS operators who use a custom same-label system LaunchDaemon: user LaunchAgent install, start, restart, and Doctor recovery now refuse rather than proceed. Priority: P1 Review scores
Verification
How this fits togetherGateway lifecycle commands manage OpenClaw’s per-user macOS LaunchAgent, while some operators run an independently managed system LaunchDaemon. The new ownership check sits before install, restart, recovery, status, and Doctor flows so those paths either activate the user service or stop with a recorded explanation instead of creating two competing gateway managers. flowchart LR
Command[Gateway command, update, or Doctor] --> Lifecycle[User LaunchAgent lifecycle]
Lifecycle --> Probe[Check same-label system LaunchDaemon]
Probe -->|No system owner| Activate[Install or restart user LaunchAgent]
Probe -->|Loaded or installed owner| Refuse[Refuse mutation with recovery guidance]
Probe -->|Cannot verify ownership| FailClosed[Stop safely and report probe failure]
Refuse --> Status[Gateway status and Doctor output]
FailClosed --> Status
Decision needed
Why: The implementation is mechanically coherent and has real macOS proof, but the compatibility tradeoff is product policy: it replaces a previously permissive, though unsafe, lifecycle path with an operator-visible refusal. Before merge
Agent review detailsSecurityNone. PR surfaceSource +474, Tests +729, Docs +15. Total +1218 across 25 files. View PR surface stats
Review metricsNone. 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: Adopt one explicit service-owner policy: retain OpenClaw’s supported user LaunchAgent path, detect custom same-label system ownership before every user-service mutation, and provide clear diagnostic-only or manual-removal recovery guidance without adding system-daemon lifecycle management in this PR. Do we have a high-confidence way to reproduce the issue? Yes, with high confidence from the reported macOS sequence and the branch’s native before/after proof: a same-label system LaunchDaemon exists, then user Is this the best way to solve the issue? Yes, conditionally: checking ownership before mutating the user service is narrower and safer than adding partial system-daemon control, provided maintainers accept the intentional fail-closed upgrade behavior and its documented recovery path. AGENTS.md: unclear because the file could not be read completely. Codex review notes: model internal, reasoning high; reviewed against c40a9b15b098. 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 (15 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review Added captured runtime before/after proof to the PR body (negative-control harness, macOS, Node 22): on unfixed |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review Added branch-(b) proof addressing the "mock-backed" note: re-ran on macOS against a REAL root-owned |
9f0f82d to
25a712c
Compare
|
QA Smoke CI failure is unrelated to this change. On the current head, the QA smoke run completes every scenario successfully — This PR is rebased onto latest Could a maintainer re-run the |
25a712c to
c6b0efe
Compare
|
@clawsweeper re-review |
Co-authored-by: Harjoth Khara <[email protected]>
7437f7f to
b3ac0fc
Compare
|
Maintainer decision: accepted the documented fail-closed single-owner policy. A same-label external system LaunchDaemon must remain the sole lifecycle owner or be removed before OpenClaw manages the supported user LaunchAgent; The ClawSweeper rank-up moves are addressed:
Native macOS proof, focused tests, Testbox type/build/dead-code/full-lint proof, docs, and final clean autoreview are recorded in the PR body. Ready to merge. |
|
Merged via squash.
|
* origin/main: (446 commits) fix(daemon): refuse duplicate launchd gateway managers (openclaw#97285) fix(memory-lancedb): share the recall cooldown with the auto-recall prompt-build hook (openclaw#112927) fix(test): isolate plugin install fixtures (openclaw#116008) fix(feishu): guard Object.assign against prototype pollution in webhook payload merge (openclaw#111729) fix(sms): isolate validated webhook quotas per sender (openclaw#104862) fix(sessions): recover deleted chats without endless retries (openclaw#115974) fix(restart): log errors from restart hook callbacks instead of swallowing (openclaw#108847) feat(ui): enable tool-loop detection from Labs (openclaw#115983) fix(telegram): catch unhandled rejections in webhook and ingress worker shutdown (openclaw#100998) fix(memory): keep rollbacks compatible after recall metadata upgrade (openclaw#116003) fix(ui): derive cron timezone suggestions (openclaw#115973) fix(scripts): bound dependency pin git lookups (openclaw#110570) fix(skills): preserve configless workshop apply upgrades (openclaw#115982) fix(gateway): cancel unread cron webhook bodies before SSRF release (openclaw#111236) fix(voice-call): pin Twilio webhook verification to the configured public path (openclaw#112800) fix(memory): make legacy session backfill rollback re-applicable (openclaw#116004) fix(security): fence external hook job name in isolated-agent prompts (openclaw#112501) fix(channels): mark durable webhook acceptance on Zalo, Google Chat, SMS, Feishu, Nextcloud Talk, and Synology Chat (openclaw#115586) fix(test): restore stdin TTY descriptors (openclaw#115985) fix(plugins): remove incorrect modifying hook timeout fallback in getClaimingHookTimeoutMs (openclaw#107996) ... # Conflicts: # extensions/openai/realtime-quicksilver-wire.ts
* origin/main: (683 commits) fix(discord): bound webhook send body reads (openclaw#109076) fix(ui): preserve initials for missing user avatars (openclaw#115976) feat(ui): add provider icons to coding catalogs (openclaw#115956) fix(daemon): refuse duplicate launchd gateway managers (openclaw#97285) fix(memory-lancedb): share the recall cooldown with the auto-recall prompt-build hook (openclaw#112927) fix(test): isolate plugin install fixtures (openclaw#116008) fix(feishu): guard Object.assign against prototype pollution in webhook payload merge (openclaw#111729) fix(sms): isolate validated webhook quotas per sender (openclaw#104862) fix(sessions): recover deleted chats without endless retries (openclaw#115974) fix(restart): log errors from restart hook callbacks instead of swallowing (openclaw#108847) feat(ui): enable tool-loop detection from Labs (openclaw#115983) fix(telegram): catch unhandled rejections in webhook and ingress worker shutdown (openclaw#100998) fix(memory): keep rollbacks compatible after recall metadata upgrade (openclaw#116003) fix(ui): derive cron timezone suggestions (openclaw#115973) fix(scripts): bound dependency pin git lookups (openclaw#110570) fix(skills): preserve configless workshop apply upgrades (openclaw#115982) fix(gateway): cancel unread cron webhook bodies before SSRF release (openclaw#111236) fix(voice-call): pin Twilio webhook verification to the configured public path (openclaw#112800) fix(memory): make legacy session backfill rollback re-applicable (openclaw#116004) fix(security): fence external hook job name in isolated-agent prompts (openclaw#112501) ... # Conflicts: # CHANGELOG.md # src/agents/tool-search-catalog.ts # src/agents/tool-search.test-support.ts # src/agents/tool-search.ts
* commit 'e80fe942c8dae4b264acb2b501466224e842aa61': fix(gateway): stop start-time repair from retargeting managed services (openclaw#115935) fix(plugins): scope Codex relay with tool matchers (openclaw#109603) fix(discord): bound webhook send body reads (openclaw#109076) fix(ui): preserve initials for missing user avatars (openclaw#115976) feat(ui): add provider icons to coding catalogs (openclaw#115956) fix(daemon): refuse duplicate launchd gateway managers (openclaw#97285) fix(memory-lancedb): share the recall cooldown with the auto-recall prompt-build hook (openclaw#112927) fix(test): isolate plugin install fixtures (openclaw#116008) fix(feishu): guard Object.assign against prototype pollution in webhook payload merge (openclaw#111729) fix(sms): isolate validated webhook quotas per sender (openclaw#104862) fix(sessions): recover deleted chats without endless retries (openclaw#115974) fix(restart): log errors from restart hook callbacks instead of swallowing (openclaw#108847) feat(ui): enable tool-loop detection from Labs (openclaw#115983) fix(telegram): catch unhandled rejections in webhook and ingress worker shutdown (openclaw#100998) fix(memory): keep rollbacks compatible after recall metadata upgrade (openclaw#116003)
* origin/main: (823 commits) fix(memory): return early for blank searches (openclaw#116034) fix(tool-search): long-lived gateways leak heap from finished embedded runs (openclaw#114767) feat(harness): report copilot code-mode engagement on the attempt result (openclaw#115913) fix(ui): compact the macOS gateway picker menu (openclaw#115977) perf(codex): stream large CLI session JSONL scans (openclaw#115997) cron: reject webhook URLs with embedded credentials (openclaw#51822) refactor(agents): remove retired Codex CLI parser (openclaw#116017) feat(mac): hand off gateway-owned settings panes to the dashboard (openclaw#115999) fix(gateway): declare viewer presence explicitly instead of deriving it from subscriptions (openclaw#116001) test(plugins): include dreaming sidecar in startup expectation (openclaw#116018) fix(openai): prevent GPT-Live errors from stalling (openclaw#115582) fix(gateway): stop start-time repair from retargeting managed services (openclaw#115935) fix(plugins): scope Codex relay with tool matchers (openclaw#109603) fix(discord): bound webhook send body reads (openclaw#109076) fix(ui): preserve initials for missing user avatars (openclaw#115976) feat(ui): add provider icons to coding catalogs (openclaw#115956) fix(daemon): refuse duplicate launchd gateway managers (openclaw#97285) fix(memory-lancedb): share the recall cooldown with the auto-recall prompt-build hook (openclaw#112927) fix(test): isolate plugin install fixtures (openclaw#116008) fix(feishu): guard Object.assign against prototype pollution in webhook payload merge (openclaw#111729) ...
* fix(daemon): block duplicate launchd owners Co-authored-by: Harjoth Khara <[email protected]> * fix(ci): satisfy launchd docs and lint gates * fix(ci): remove unused launchd exports * docs: refresh gateway map --------- Co-authored-by: Peter Steinberger <[email protected]>
Closes #97178
What problem this solves
On macOS, a custom system-domain LaunchDaemon and OpenClaw's user LaunchAgent could supervise the same gateway label and port at once. Their independent
KeepAliveloops can repeatedly kill and respawn the gateway, disconnecting clients and making the gateway unusable.What changed
This PR now has one fail-closed system-ownership boundary for the complete user LaunchAgent lifecycle:
launchctl print system/<label>;plutil, including noncanonical filenames;gateway statusreports a loaded system owner instead of telling the operator to install a user service;gateway status --deepreports installed same-label LaunchDaemons;--forcenever overrides system ownership.OpenClaw still does not install, stop, restart, or uninstall system LaunchDaemons. Broader system-daemon lifecycle support remains in #14251 and #51860.
User impact and recovery
Operators now get a precise refusal instead of a second manager. They can keep the system LaunchDaemon as the sole owner and set
OPENCLAW_SERVICE_REPAIR_POLICY=externalfor diagnostic-only Doctor runs, or unload/remove the custom system service before installing the supported user LaunchAgent. The Gateway and Doctor docs cover both paths.Evidence
Exact rewritten head:
d64074b00197723c2db373f7d3590c31c1c4e821.oxfmt,oxlint, andgit diff --checkpassed.Fork CI twice terminated the 32-vCPU lint lane on its 4-vCPU fallback with SIGTERM 143 and no lint finding. The exact same SHA passed full lint on Testbox and in the same-repository Blacksmith matrix above.
Release note
macOS: prevent duplicate system LaunchDaemon and user LaunchAgent gateway managers, with fail-closed recovery guidance. Thanks @harjothkhara for the original diagnosis and patch.
AI-assisted: yes. The maintainer rewrite was manually traced across all lifecycle callers, dependency/system contracts, tests, docs, and native behavior.