Repository navigation
fix(update): allow verified macOS handoffs to activate - #156972
Conversation
Bind the admitted managed updater native service scope to its live executor fence across execution and recovery. Preserve ordinary service guards and prove the production caller, retained service roots, and ownership revocation. Reported and reproduced by @hannesrudolph in #156878.
|
🦞👀 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: blocked before merge. Reviewed September 23, 2026, 11:36 PM ET / September 24, 2026, 03:36 UTC. ClawSweeper reviewWhat this changesThe branch binds managed updater runs to a live native service authority scope, expands LaunchAgent caller tests, and documents recovery from an older installed updater. Merge readiness⛔ Blocked before merge - 2 items remain Keep open. Current main still lacks the authority composition needed for the linked macOS activation failure, and the earlier merged native-stop work does not supply it. Priority: P1 Review scores
Verification
How this fits togetherControl UI and CLI update requests enter the updater, which admits an executor, prepares a candidate, and asks the native service manager to stop and restart the Gateway. On macOS, the LaunchAgent stop guard consumes the updater's live authority before stopping the service. flowchart LR
A[Control UI or CLI update] --> B[Updater admission]
B --> C[Live executor fence]
C --> D[Native service authority]
D --> E[LaunchAgent stop guard]
E --> F[Gateway stop and restart]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +28, Tests +233, Docs +7. Total +268 across 4 files. View PR surface stats
Review metrics
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: Preserve the caller-bound live executor authority and the existing fail-closed LaunchAgent guard, with a verified native macOS update completing stop, restart, and readiness. Do we have a high-confidence way to reproduce the issue? Yes. The linked report supplies a deterministic pre-fix source-boundary reproduction and an observed Control UI failure; this read-only review did not execute the updater. Is this the best way to solve the issue? Yes. Establishing native authority at the admitted updater follows the existing ownership boundary, while the ordinary service adapter and final LaunchAgent checks remain in place. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2167eab4cfd2. 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
|
Bind the admitted managed updater native service scope to its live executor fence across execution and recovery. Preserve ordinary service guards and prove the production caller, retained service roots, and ownership revocation. Reported and reproduced by @hannesrudolph in openclaw#156878.
Fixes #156878
What Problem This Solves
A valid managed macOS update handoff could complete candidate validation, then fail activation with
managed-service-stop-failedbecause the admitted updater never established the native update-owned authority scope.Thanks to @hannesrudolph for the report and deterministic Node 26 reproduction harness.
Why This Change Was Made
The admitted
updateCommandcontinuation now binds native service authority to its live executor fence across execution and recovery. It retains the updater's installation root, including when a separate managed-service root is leased, and rejects a replaced run/fence or revoked owner. The ordinary service adapter and LaunchAgent stop guards remain unchanged; a root/run tuple does not grant native authority. The same caller composition applies on Linux.Production delta: +41/−13 lines. The growth belongs at the admitted caller: it composes the existing executor and native authority owners without granting authority in the ordinary adapter. The native regression fixture now exercises the real updater caller instead of supplying the missing authority scope itself.
User Impact
Verified managed helpers can reach native macOS activation while ordinary nested callers, invalid handoffs, and lost ownership still refuse before mutation. There are no new configuration options, CLI options, dependency changes, or database schema changes.
Release/backport scope: the report's
2026.9.5installation was a later Git/dev build. Tagged 9.5 has the older ancestry refusal; tagged 9.6 lacks this scope-dependent guard. This exact omission affects source revisions carrying the guard introduced ine0dc76b38b0(#155433); backport to those revisions/lines rather than treating both published tags as having the same defect. An installed defective updater must be repaired before retrying: it stops the service before candidate activation, so a candidate-only patch cannot repair the running driver. The docs describe updating from an external terminal using the same installation owner.Evidence
560d15c55ab5a9b379f1a122c6d381b6a4d688c7: 10/10 diagnostic assertions passed. Native effects were mocked; no running installation was touched.managed-service-stop-failed/ LaunchAgent ancestry refusal. With the fix, all 12 native cases pass, covering valid activation, retained service roots, ordinary callers, invalid handoffs, and executor revocation. Focused Testbox cost: 20.32 s wall, about 5.2 s test time.check:changedpassed withOPENCLAW_TESTBOX=1on Blacksmith Testboxtbx_01m38j15y74by8eebk0xhfte6c, including production types, all 25 test typecheck groups, lint, formatting, and the selected architecture/documentation guards.src/cli/update-cli.test.tsaccounts for 515 passing cases and 226.447 s summed test time; this existing file-level cost is explicitly waived for this fix and assigned to separate performance work. This patch does not weaken, skip, or tier the regressions.--mode branch --base origin/main) is clean with no actionable P0–P2 findings.update.runRPC with a local artifact was attempted for both drivers but stopped before activation withtarget-metadata-preflight: target resolution invokesnpm view file:<candidate.tgz>, which returns 404. The successful live cells below use the supported explicit-file CLI route and real managed helpers. No npm metadata shim or artifact-version change was used. Native macOS service effects remain mocked in the source-boundary regression; the real native service proof is Linux/systemd.--tag file:<candidate.tgz> --yes --jsonpath and a real managed handoff. Rund0d3a88f-c70f-49ef-8b28-0a31737ba8eefinishedsucceeded; native unit snapshots show PID 14236 replaced by 16804, the original PID received SIGTERM and shut down cleanly, and the updated Gateway reportedserviceRunning,channelsReady,readyz,versionMatch, andsettledall true. The candidate is the current source build labeled 2026.9.5, so this is an explicit artifact compatibility cell, not a registry-version upgrade claim.9f09ee25-c698-4e09-bea7-1a8e92108128reachedsucceeded; the exact systemd unit records PID 20717 receiving SIGTERM and completing clean shutdown, followed by PID 23285 startup. Native active-state snapshots, public ledger, version, readiness, and settlement checks passed. The new driver executes native stop before its package is replaced.tbx_01m38j2djkm8kfq8dy45n800ke, using dedicated OS accounts, canonical state beneath task-owned homes, and free ports. Candidate tar SHA-256:bccab029176f8e6478d36ee4474a305d82a207613436e908d5b0ac5289556f17; published 9.6 tar SHA-256:1a7355691bc0e605222ba818f1f72c1787253c78dfeb0df6be2086ec73b71e63. Stop evidence is service-bound journal records plus systemd snapshots; systemd-manager log messages are not claimed.Auto-merge remains off for lead review.