Repository navigation
fix(update): accept a re-linked launcher during the swap and keep triage usable without safe mode - #164438
Conversation
Verify rollback launcher backups by content and accept equivalent npm symlink relinks during observation. Preserve mutation ownership checks and name both targets when a launcher changes to a foreign target. Run Claude triage without safe mode with a visible notice when the installed CLI lacks support, including automatic recovery. Release-note context: updates tolerate equivalent launcher metadata changes, and older Claude Code remains usable for recovery triage. Reported on Discord by junior.
|
🦞👀 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 October 3, 2026, 2:05 PM ET / 18:05 UTC. ClawSweeper reviewWhat this changesThe branch tolerates equivalent launcher relinking during updates and lets older Claude Code run recovery triage with a visible notice about normal customization settings. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 3 items remain The repair remains useful and is absent from current main, but the relaxed launcher comparison can certify rollback after restoring a non-executable shim. Priority: P2 Review scores
Verification
How this fits togetherThe package updater captures launcher backups before replacing an installation and verifies them during rollback. Triage turns installation failure diagnostics into a repair prompt for an available coding agent. flowchart TD
A[Installed package and launcher] --> B[Capture recovery material]
B --> C[Verify launcher content]
C --> D[Activate candidate package]
D --> E[Verify or restore installation]
E --> F[Failure diagnostics]
F --> G[Probe Claude capabilities]
G --> H[Run repair prompt]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +9, Tests +116, Docs +7. Total +132 across 11 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Accept harmless launcher relinking while preserving runnable rollback shims, and demonstrate safe recovery when a published updater installs the candidate. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the introduced failure: start with an executable regular-file launcher, remove execute permission from its byte-identical backup, and force rollback. No runtime reproduction was executed during this read-only review. Is this the best way to solve the issue? Mostly: repairing the existing integrity and triage owners is appropriate, but regular-file executability must remain part of successful recovery. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f7d9a968f278. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What 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
|
…age usable without safe mode (openclaw#164438) On Homebrew-managed installs, openclaw update passed every validation step and then failed the global install swap with 'Package rollback launcher backup changed: /opt/homebrew/bin/openclaw' because npm re-links the bin symlink during install (new inode/mtime, same target) and the launcher backup check compared inode-level identity. The integrity owner now accepts an equivalent relink and compares backup content; a launcher whose target or type changed still refuses with both targets named, so rollback stays restorable. The built-in triage no longer dead-ends when Claude Code lacks --safe-mode: it prints a visible notice and falls back to claude -p. Reported on Discord (#Openclaw not working, junior).
What Problem This Solves
Fixes updates aborting when npm/Homebrew re-links an equivalent launcher during rollback verification, followed by recovery triage failing because an older Claude Code lacks
--safe-mode.Discord report:
@junior, “Openclaw not working”, 2026-10-03 08:27 UTC. The macOS/Homebrew update to 2026.9.8 passed candidate validation, then failed atPackage rollback launcher backup changed: /opt/homebrew/bin/openclaw; Claude triage also exited unsuccessfully.User Impact
Equivalent launcher links and byte-identical backup shims survive metadata changes. Foreign link targets still refuse before activation and name both expected and actual targets. Older Claude Code runs the saved repair prompt after a visible notice that normal customization settings apply.
The launcher fix belongs to the installed updater. A staged candidate cannot change the checks of an already-running older driver; this PR does not claim to repair that first update hop.
Why This Change Was Made
The existing package-integrity owner compares backup type and content and re-reads symlink targets instead of requiring inode/timestamp immutability during observation. The filesystem owner continues capturing recovery material before activation, preserving supported metadata, and enforcing exact-object authority around mutations. The obsolete ownership-preserved return value is removed; journal encoding is unchanged.
The triage owner checks Claude support in interactive and automatic recovery, retains safe mode where available, and otherwise prints one notice and runs
claude -p. Cancellation reaches the automatic capability probe.Evidence
ino,mtimeNs, andctimeNschanged while the target stayed../lib/node_modules/openclaw/openclaw.mjs; backup content differences were empty. Re-linking during observation failed the original swap withPackage rollback launcher changed during verification, then committed successfully with the fix. The report did not include its differing-fields suffix, so the fixture establishes the reproduced relink defect rather than the reporter’s exact metadata delta.node scripts/run-vitest.mjs <touched files> --maxWorkers=1. After correcting a nullable assertion-message type, the launcher suite passed again (3 tests, 12.31 seconds wall) and its affected TypeScript graph passed.test/scripts/ci-node-test-plan*.test.tssuites passed 125 tests in 80.22 s wall for the new regression file.node scripts/check-changed.mjs: exit 0, including all core/test typechecking graphs, lint, dead-export scans, and guards.git diff --checkpassed.Slow pre-existing suites (waived)
src/cli/update-cli/update-command-original-service.test.tscompleted 54 passing tests in 324.315 seconds of test time, separate from shared compilation; the slowest test took 21.010 seconds. This is the pre-existing suite behind the earlier 181-second partial run. Its cost is explicitly waived by the maintainer, and its fixtures are unchanged.Validation is local under the explicit infrastructure ruling, using isolated fixtures and no operator Gateway/state. Hosted CI timing is not yet available. Auto-merge is off.