Repository navigation
fix(macos): preserve service runtime when installation loses authority - #193122
Conversation
Prepare the stable service Bun privately, revalidate installation authority before publication, and only roll back the executable this attempt owns. Preserve newer replacements and existing first-install settlement behavior. Related: #186107 Co-authored-by: RomneyDa <[email protected]>
|
🦞👀 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: needs real behavior proof before merge. What this changesThis PR prepares the macOS service executable privately, rechecks installation authority before publication, and preserves newer replacements during rollback. Example: Installation of build B is canceled while build A uses runtime/service/bun.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 3 items remain Keep this maintainer-authored PR open: it addresses a source-verifiable runtime ownership defect still present on main, and no definite introduced bug was found. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe macOS app coordinates Gateway installation through GatewayLaunchAgentManager, while BundledRuntime owns executable preparation and publication at the stable service path. flowchart TD
A[App update or hosting change] --> B[GatewayLaunchAgentManager]
B --> C[Private executable preparation]
C --> D[Current authority checks]
D --> E[Stable executable publication]
E --> F[Bundled CLI installation]
F --> G[Identity checked settlement]
Technical reviewBest possible solution: Retain the existing installation and runtime owners, publish only after their current authority checks, and restore only the executable owned by the failed attempt. Do we have a high-confidence way to reproduce the issue? Current-main source exposes both premature executable publication and unconditional rollback; no target code was executed during this read-only review. Is this the best way to solve the issue? The patch is a focused root-cause repair: private preparation separates expensive work from publication, existing authority owners retain the decision, and file identity limits rollback without introducing a competing owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 658e3db2a464. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: none. SecurityNeeds attention: No concrete bypass was found, but executable publication under withdrawn authority still needs final-effect proof. EvidenceWhat I checked:
PR surfaceSource +64, Tests +93. Total +157 across 4 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 4, 2026, 9:04 PM ET / November 5, 2026, 02:04 UTC. |
Preserve throwing fixture reads outside Swift Testing macros, align standalone-session expectations with their owner, and reuse the bootstrap join. Format the service-runtime initializer without changing behavior. Co-authored-by: RomneyDa <[email protected]>
|
Merged via squash.
|
Adopt complete #186107 and the four native-owner repairs from merged #193122. Preserve existing beta documentation and exclude unrelated main-only chat fixtures. Exact-candidate qualification remains with release CI. Co-authored-by: RomneyDa <[email protected]>
openclaw#193122) * fix(macos): preserve service runtime when installation loses authority Prepare the stable service Bun privately, revalidate installation authority before publication, and only roll back the executable this attempt owns. Preserve newer replacements and existing first-install settlement behavior. Related: openclaw#186107 Co-authored-by: RomneyDa <[email protected]> * fix(macos): repair native qualification fixtures Preserve throwing fixture reads outside Swift Testing macros, align standalone-session expectations with their owner, and reuse the bootstrap join. Format the service-runtime initializer without changing behavior. Co-authored-by: RomneyDa <[email protected]> --------- Co-authored-by: RomneyDa <[email protected]>
openclaw#193122) * fix(macos): preserve service runtime when installation loses authority Prepare the stable service Bun privately, revalidate installation authority before publication, and only roll back the executable this attempt owns. Preserve newer replacements and existing first-install settlement behavior. Related: openclaw#186107 Co-authored-by: RomneyDa <[email protected]> * fix(macos): repair native qualification fixtures Preserve throwing fixture reads outside Swift Testing macros, align standalone-session expectations with their owner, and reuse the bootstrap join. Format the service-runtime initializer without changing behavior. Co-authored-by: RomneyDa <[email protected]> --------- Co-authored-by: RomneyDa <[email protected]>
Related: #186107
What Problem This Solves
Fixes: a canceled or superseded macOS Gateway installation can replace the live service runtime before rejecting the operation, and failed-install cleanup can overwrite a newer runtime replacement.
User Impact
Service updates preserve the installed executable when installation authority is withdrawn, and preserve a newer executable if another installation replaces it before failure cleanup. The stable Automation-grant path and per-build package/SQLite selection remain unchanged. No configuration migration or user action is introduced.
Why This Change Was Made
Prepare the candidate and backup privately, then recheck current update authority, cancellation, and captured service custody immediately before publication. Bind publication and rollback to the relevant file identity instead of unconditionally replacing the live path. Retain existing equal-byte no-op and partially successful first-install behavior.
This repairs the stable-runtime implementation from #186107 while preserving its contributor history. The short cross-process check-to-rename race remains outside this narrow repair; this is not a general filesystem transaction or protection against in-place edits/adversarial inode reuse.
Evidence — November 5, 2026
806d1a28986f50a1f132ba5feaed8e9500565e8c, tree85e102dce62cca081ffca14ca5c93e78c0c294be. Independent source reviews approved the original repair and the three-file compilation/fixture/layout correction; assertions and production behavior are preserved.06951a90db7ff9265e31e67c8042053764e76289.127021576379, completed 03:27:56 UTC, reported 11 issues across DashboardNativeBrowserFailureTests (stop-settlement timeout), DashboardExperienceTests (handoff route expectation), and DashboardCloseShortcutTests (close scope timeout/window and panel expectations). Nine issues match failures in scheduled main run41955318723, job127014157987; the two stop-settlement timeout issues remain unclassified. Unchanged source alone is not inherited-failure proof. Bundled recovery was skipped after failure, and broader non-native CI accounting remains in progress.e670d461c3ba4cd8c3da9f18425b30b597269f11b64f19f39302b31b2c6aaeba, based onaa401d8fbdd5ac7eb2755022744f33e996fae85b. Reviewed follow-up delta:2f62be945ea1f9bb34c1277fa95a56b1bc9474cf715e6cd108c10e387ee15928.git diff --checkand test-line ratchet passed: 6,476,480 <= 6,476,564 (84 slack); no baseline/allocation changes. App/shared-kit assertion counts remain 428/1,544.Open for review, not yet qualified to merge: focused runtime proof and builds pass, but the remaining failed-CI disposition is unresolved. Baseline-red execution, real launchd/TCC behavior, and signed stable-to-candidate upgrade remain unproved; those limitations are not claims of completed qualification. Generic installed-CLI upgrade evidence for a separate updater repair does not establish these native claims. No workflow change is part of this repair.