Repository navigation
fix(macos): keep embedded CUA unavailable when PID tracking fails - #124572
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 16, 2026, 8:45 AM ET / 12:45 UTC. ClawSweeper reviewWhat this changesThe PR prevents embedded macOS CUA from becoming ready when its daemon PID record cannot be fully persisted, then stops and cleans up that daemon through the existing lifecycle. Regression provenancePossible regression — probable (reviewed change; known regression link). No predecessor PR is attributed. Merge readinessKeep open for maintainer review: current main still ignores failed PID publication, while this focused owner-bound repair appears correct and has supplied native fault-injection evidence. Priority: P2 Review scores
Verification
How this fits togetherEmbedded CUA starts a local macOS daemon, records its PID in an owned socket directory, and only then makes a worker endpoint available to node execution and the readiness UI. The PID file is the lifecycle record needed to stop the exact spawned daemon. flowchart LR
A[CUA enabled] --> B[Launch embedded daemon]
B --> C[Record daemon PID]
C --> D{PID publication succeeded?}
D -->|Yes| E[Probe socket readiness]
E --> F[Expose worker endpoint]
D -->|No| G[Stop child and clean directory]
G --> H[Bounded restart]
F --> I[Node worker and readiness UI]
Decision needed
Why: The patch changes privileged embedded-daemon startup behavior, and this review could not independently inspect the Foundation implementation that supplies its full-write guarantee. Before merge
Agent review detailsSecurityNone. PR surfaceOther +40. Total +40 across 3 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the fail-closed owner-bound lifecycle repair once exact-head macOS validation confirms complete PID persistence under the injected short-write path. Do we have a high-confidence way to reproduce the issue? Yes, from source: a partial PID write returns false on current main, yet startup ignores that result and can publish a ready endpoint when its readiness probe succeeds. The review did not execute the macOS fault injector locally. Is this the best way to solve the issue? Yes for the lifecycle boundary: PID publication must succeed before readiness, and failure belongs in the existing child-stop and restart owner rather than in downstream consumers. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 751160109270. 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
|
|
Maintainer landing verification for head
Known proof gap: CI does not rerun the local DYLD interposer, but the interposed candidate blobs are byte-identical to this head and exact-head native CI is green. No release or deployment is included. |
|
Merged via squash.
|
What Problem This Solves
Fixes an issue where macOS users enabling the embedded CUA computer provider could have it advertised as ready after a legal positive short write truncated its authoritative PID record. Later lifecycle cleanup could then be unable to attribute and reap the exact privileged daemon that OpenClaw spawned.
Why This Change Was Made
The PID publication owner now uses Foundation's throwing full-write operation on the existing securely opened, non-owning descriptor. Startup records the exact child before publication and, if publication fails, reuses the existing stop/kill, directory cleanup, and bounded restart lifecycle instead of advancing to readiness.
Successful launches keep the same path, ownership checks, file mode, readiness flow, and teardown behavior. This changes no config, protocol, persistence schema, public API, or permission policy.
User Impact
Embedded CUA will no longer become available with a truncated or missing authoritative PID record. On the rare publication failure path, OpenClaw leaves no endpoint, process, or owned socket directory behind and retries only through the existing bounded restart policy.
Evidence
AI-assisted maintainer repair; the implementation and proof were directly reviewed.