Skip to content

fix(update): allow verified macOS handoffs to activate - #156972

Merged
steipete merged 1 commit into
mainfrom
upd/macos-update-authority-scope
Sep 24, 2026
Merged

steipete merged 1 commit into
mainfrom
upd/macos-update-authority-scope

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Fixes #156878

What Problem This Solves

A valid managed macOS update handoff could complete candidate validation, then fail activation with managed-service-stop-failed because 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 updateCommand continuation 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.5 installation 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 in e0dc76b38b0 (#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

  • Reporter's Node 26 harness reproduced the stock defect at 560d15c55ab5a9b379f1a122c6d381b6a4d688c7: 10/10 diagnostic assertions passed. Native effects were mocked; no running installation was touched.
  • The production-path regression fails before the fix with the exact 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.
  • Committed-head check:changed passed with OPENCLAW_TESTBOX=1 on Blacksmith Testbox tbx_01m38j15y74by8eebk0xhfte6c, including production types, all 25 test typecheck groups, lint, formatting, and the selected architecture/documentation guards.
  • The completed importer infra shard passed 538 tests. src/cli/update-cli.test.ts accounts 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.
  • Fresh committed-branch autoreview (--mode branch --base origin/main) is clean with no actionable P0–P2 findings.
  • All 31 selected importer test files pass (1,025 tests): the 670 tests completed before the stop plus the remaining 355 tests on the committed head. The latter run includes the unchanged native regressions. Shared E2E runtime preparation took 5m52s and is separate from test execution time.
  • Remaining proof limit: the update.run RPC with a local artifact was attempted for both drivers but stopped before activation with target-metadata-preflight: target resolution invokes npm 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.
  • Published 2026.9.6 driver × candidate artifact completed through the supported CLI --tag file:<candidate.tgz> --yes --json path and a real managed handoff. Run d0d3a88f-c70f-49ef-8b28-0a31737ba8ee finished succeeded; native unit snapshots show PID 14236 replaced by 16804, the original PID received SIGTERM and shut down cleanly, and the updated Gateway reported serviceRunning, channelsReady, readyz, versionMatch, and settled all 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.
  • Fixed candidate driver → authentic published 9.6 artifact also passed through a real CLI managed handoff. Run 9f09ee25-c698-4e09-bea7-1a8e92108128 reached succeeded; 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.
  • Both live cells ran on Blacksmith Testbox 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.

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.
@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes size: M labels Sep 24, 2026
@steipete
steipete marked this pull request as ready for review September 24, 2026 03:27
@steipete
steipete enabled auto-merge (squash) September 24, 2026 03:32
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 24, 2026
@clawsweeper

clawsweeper Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 23, 2026, 11:36 PM ET / September 24, 2026, 03:36 UTC.

ClawSweeper review

What this changes

The 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
Reviewed head: 41c0736607e59e872cd6147682c36ab64e395dd5

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch follows the existing authority owners and has focused regression coverage, but its macOS outcome still lacks native platform proof.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: The supplied repository state identifies a member-authored PR, so the ordinary external-contributor proof gate does not apply. The PR body reports two real CLI/systemd handoffs through the changed updater with PID replacement and readiness; macOS LaunchAgent I/O remains mocked and needs separate platform proof. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied repository state identifies a member-authored PR, so the ordinary external-contributor proof gate does not apply. The PR body reports two real CLI/systemd handoffs through the changed updater with PID replacement and readiness; macOS LaunchAgent I/O remains mocked and needs separate platform proof. No stored-data contract changes.
Evidence reviewed 10 items Introduced caller change: The pinned PR delta adds a native authority scope around admitted update execution and binds its assertion to the run and executor fence.
Current-main gap: The fetched main revision enters recovery and update execution without establishing the native update-owned scope; the verified test merge adds this branch's caller change.
Final native guard: Inside the serving LaunchAgent, native stop requires update-owned authority and a current managed handoff before proceeding.
Findings None None.
Security None None.

How this fits together

Control 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]
Loading

Before merge

  • Resolve merge risk (P1) - The PR demonstrates real managed handoffs on Linux, but the macOS LaunchAgent stop and restart remain simulated; activation and recovery on a task-private macOS service have not yet been observed.
  • Complete next step (P2) - Record an isolated macOS managed update through the installed driver and candidate, including LaunchAgent stop, replacement startup, and Gateway readiness.
Agent review details

Security

None.

PR surface

Source +28, Tests +233, Docs +7. Total +268 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 1 41 13 +28
Tests 2 258 25 +233
Docs 1 7 0 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 306 38 +268

Review metrics

Metric Value Why it matters
Production and test delta production +41/−13; tests and support +258/−25 The production growth composes existing authority owners at the admitted caller; most added lines exercise that caller and its native boundary.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #156878
Summary: This PR is the candidate repair for the linked activation report; the earlier merged native-stop PR addresses adjacent restart-intent behavior.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Prove macOS activation (recommended)
    Run an isolated managed update on macOS with a task-private LaunchAgent and record the native stop, replacement service startup, and final readiness before merge.

Technical review

Best 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.

Labels

Label changes:

  • add P1: The linked report records a managed Control UI update failing at activation after candidate preparation.
  • add merge-risk: 🚨 availability: The change enables native service stop for verified macOS handoffs, while after-fix LaunchAgent stop and restart remain unobserved on macOS.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied repository state identifies a member-authored PR, so the ordinary external-contributor proof gate does not apply. The PR body reports two real CLI/systemd handoffs through the changed updater with PID replacement and readiness; macOS LaunchAgent I/O remains mocked and needs separate platform proof. No stored-data contract changes.

Label justifications:

  • P1: The linked report records a managed Control UI update failing at activation after candidate preparation.
  • merge-risk: 🚨 availability: The change enables native service stop for verified macOS handoffs, while after-fix LaunchAgent stop and restart remain unobserved on macOS.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied repository state identifies a member-authored PR, so the ordinary external-contributor proof gate does not apply. The PR body reports two real CLI/systemd handoffs through the changed updater with PID replacement and readiness; macOS LaunchAgent I/O remains mocked and needs separate platform proof. No stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • fuller-stack-dev: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Capture a task-private macOS LaunchAgent update showing native stop, replacement startup, and final Gateway readiness.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 048cc4e into main Sep 24, 2026
264 of 266 checks passed
@steipete
steipete deleted the upd/macos-update-authority-scope branch September 24, 2026 03:46
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 24, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: macOS updater omits native update authority and rejects valid handoffs at activation

1 participant