Repository navigation
fix(update): preserve macOS launcher permissions during updates - #145282
Conversation
|
🦞👀 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 maintainer review before merge. Reviewed September 11, 2026, 10:52 PM ET / September 12, 2026, 02:52 UTC (Revision 5). ClawSweeper reviewWhat this changesThe PR preserves macOS launcher symlink permissions during package backup, activation, and rollback, and adds launcher and update-fixture regression coverage. Merge readiness✅ Ready for maintainer review This remains a useful, narrowly scoped repair: current main and v2026.9.4 still contain the mismatch. Native update-and-rollback evidence supports the implementation, and no actionable correctness or security findings remain. Priority: P0 Review scores
Verification
How this fits togetherOpenClaw’s package updater copies command launchers while replacing an installed npm package. The same filesystem owner prepares backups, publishes candidate launchers, and restores previous launchers when activation fails. flowchart TD
A[Installed launcher] --> C[Atomic launcher copy]
B[Candidate launcher] --> C
C --> D[Preserve macOS link permissions]
D --> E[Verify backup fingerprint]
E --> F[Activate candidate]
F --> G[Restore retained launcher on failure]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +5, Tests +132. Total +137 across 4 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Preserve launcher metadata in the existing copy owner, while tracking a visible Fix path for affected older updaters in #145072. Do we have a high-confidence way to reproduce the issue? Yes: current source recreates macOS symlinks under the updater’s umask and then compares their modes strictly. Independent reports and the supplied native matrix establish both mismatch directions; this review did not execute a current-main reproduction. Is this the best way to solve the issue? Yes: correcting the shared copier preserves the existing integrity contract and covers backup, activation, and restoration without adding another implementation path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against af135e068540. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
Extend the retained launcher regression from openclaw#145282 (@PollyBot13) to use separate old and candidate symlink targets on macOS and Linux. Verify the staged launcher mode, restored mode and ownership, target executable bits, and executable permissions on hardlinked launchers. Refs openclaw#145072. Thanks to @yuxiao345 and @alexph-dev for the reproduction.
Version stamping changed build-info.json without regenerating its packaged content hash. Modern updaters rejected those targets before installation, and removed compatibility chunks also left stale inventory entries. Regenerate through the existing inventory writer for modern artifacts while preserving the capability set of older frozen packages. Cover all five version and compatibility transform entry points with the real validator. Refs openclaw#145072 and openclaw#145282.
Keep the mainline fixture inventory updater from aa0ad4c and retain the five additional fixture transformation cases. This preserves corruption detection and removes the superseded full inventory regeneration helper.
|
Merged via squash.
|
…claw#145282) macOS: npm updates no longer fail with `Package rollback launcher backup changed` when the updater's umask differs from the installed launcher symlink's permissions; the symlink mode is preserved through backup, activation and rollback. Keep launcher fingerprints strict and preserve link metadata at the shared copy owner before atomic publication. Regression coverage verifies old/new targets, staged permissions, retained rollback, dangling links, metadata failures, hardlinked launchers, and modern package fixture inventories. Native macOS owner comparisons pass in both umask directions. Packaged fixed-driver update exits 0; injected Doctor failure restores the previous package and launcher with packageRollbackVerified=true. Published 2026.9.4 initial attempts reached its earlier fingerprint timeout, so this does not claim rescue of the already-running old updater. Related openclaw#145072. Thanks to @RileyJJY for the analysis and comparison. Co-authored-by: PollyBot13 <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
) The global-install-failed reason-code entry still claimed no published release contained both openclaw#145282 and openclaw#144758. Both landed in v2026.9.5 (f19a973, cdb8e14), so users stuck on the 2026.9.3/2026.9.4 updater need the manual hop only once. Co-authored-by: Peter Steinberger <[email protected]>
Related: #145072
What Problem This Solves
Fixes an issue where macOS users retrying an npm update receive
Package rollback launcher backup changedwhen the updater's umask differs from the installed launcher symlink's permissions.Why This Change Was Made
Preserve the symlink's mode with macOS
lchmodbefore the existing atomic publication. Keep launcher fingerprints, ownership checks, and failure cleanup unchanged; never follow the link or change its target's permissions. The same copy owner serves backup and retained rollback.User Impact
An updater containing this fix can copy and restore launchers created under either restrictive or ordinary umasks. Linux and Windows behavior is unchanged.
First-upgrade limitation: this is prevention in the fixed driver, not a rescue for an already-running 2026.9.3/9.4 updater. The published 2026.9.3 driver owns the faulty copy and rejects its backup before activation; putting this fix only in its candidate does not replace that driver. This PR therefore references rather than closes #145072. Existing-install recovery/release delivery remains separate.
Evidence
package-update-filesystem.test.ts,package-update-swap.integrity.test.ts,package-update-swap.ownership.test.ts, andpackage-update-swap.bounds.test.tsusingnode scripts/run-vitest.mjs.077, updater022: original0700, bare copy0755, fixed copy/restored launcher0700.022, updater077: original0755, bare copy0700, fixed copy/restored launcher0755.git diff --checkpass. Fresh native autoreview of the combined diff is scoped-clean at P1, with no actionable findings.config-cli: 721 test roots exceeds the 720 limit. This patch changes neither test-file membership nor the shard configuration. The standalone type-aware lint command also stops before linting because declaration preparation rejects dependency lookup into an ancestor checkout installation; this is a local worktree isolation limitation. No baseline, timeout, dependency, or lockfile was weakened or changed for this repair.Published-driver × candidate proof and macOS comparison
Real APFS execution of the exact source revisions:
0700, updater umask0220755, updater umask0776a971911e06207fbc34a71a7070007554cdbf2fcb1b807550700macOS 27.0, APFS, Node 26.8.2, npm 11.19.1; isolated synthetic prefix and state. The exact
07fbc34a71a7385abb6b889d0899c2e5c88ee625candidate passed the canonical Linux package build and integrity check (tarball SHA-2565b76430dbe5f6e23b8295b299d433a096c51af01dd305d28875ecfa46a361f14). Commands used the installed launcher:0700mode remained unchanged. These do not establish the exact published-CLI mode refusal; that refusal is reproduced in the main owner matrix..3version fixture, fixed normal update.3→.4returned CLI exit 0, changed the package inode, and published the staged launcher as0755..4→.5under umask077: post-activation Doctor exited 97. CLI exited 1 withdoctor-failed;global install rollbackexited 0, andpackageRollbackVerifiedwas true..4, the original package inode, symlink target, launcher mode0755, and target mode0755. The launcher executed afterward and no transaction residue remained.Full hashing exceeded its budget, so recovery explicitly used retained directory identity/version and launcher fingerprints. Service restart was not tested. Fixture suffixes describe synthetic package versions, not upgrades between published releases. The published driver attempts and the successful subsequent fixed-driver runs are distinct evidence cells.
Linux launcher regression proof · Exact candidate package builder
Maintainer additions
Maintainer commits
3b276ae6515(test(update): verify launcher targets and permissions through rollback) and0b1ba898db3(test(update): refresh content inventories in first-hop fixtures) add distinct old/new targets, staged permissions, Linux coverage, hardlinked executable launchers, and valid packaged fixture transformations. Main subsequently gained the narrower fixture-inventory repair inaa0ad4c7804; integration keeps that implementation, including its corruption-detection behavior, and retains the additional five transformation cases. Thanks to @PollyBot13 for the fix and @RileyJJY for the analysis and alternative comparison.The packaged proof and first-upgrade limitation above address ClawSweeper's requested behavior evidence and Rank-up move. Existing-install recovery remains separate under Related #145072.
Scope: five production lines plus regression tests, no dependency or schema changes. Reverting the launcher patch restores prior behavior.
Maintainer disposition and current CI
The refreshed review of
9fe875b3d2d159ef12ba8160d11a6aeb1ee6fef3accepts the behavior proof and reports no correctness or security findings. The earlier Rank-up request is addressed by the published-driver versus fixed-driver evidence above. The remaining merge-risk note is an accepted scope boundary: this repair prevents recurrence once the fixed updater is installed; affected older-driver recovery stays in the separately tracked work under #145072. The landing decision for this focused copier repair does not claim first-upgrade rescue or service restart coverage.Exact-head CI run 34667406704 completed successfully across 162 jobs (including conditional skips), with
openclaw/ci-gatesuccessful and no reruns. The refreshed merge ref includes the mainline repairs from #145415 and #145431.The earlier run 34661178456 failed on unrelated mainline shard-cap and Control UI lint/deadcode/cursor-policy checks. Those failures were repaired upstream; this PR's head and four-file repair diff remain unchanged. No checks or assertions were weakened.
ClawSweeper's latest completed exact-head review reports Before merge: None, no correctness or security findings, and sufficient behavior proof. No Rank-up move remains outstanding.