Repository navigation
fix(install): avoid success after incomplete lifecycle changes - #125992
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 18, 2026, 10:48 PM ET / August 19, 2026, 02:48 UTC. ClawSweeper reviewWhat this changesThe PR makes standalone installation, update, and uninstall commands report success only after required lifecycle work, verification, and cleanup complete. Merge readinessNo concrete patch defect was found. The previous PATH-wrapper blocker is addressed, but this protected lifecycle/upgrade PR should remain open until exact-head package and platform acceptance evidence settles. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherOpenClaw installers and flowchart LR
A[Install or update request] --> B[Prepare candidate]
B --> C[Verify lifecycle and Doctor]
C --> D[Activate replacement]
D --> E[Retire previous owner]
E --> F[Report final result]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +150, Tests +1046, Docs +11, Config +62, Other +515. Total +1784 across 31 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: 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: Retain the canonical prepare→verify→activate→retire→report sequence and merge only after exact-head npm 12 package acceptance and required platform lanes verify it; no safe shared implementation fits the separate shell, PowerShell, and TypeScript owners. Do we have a high-confidence way to reproduce the issue? Yes for source: current tests construct two matching legacy PATH wrappers and verify that successful transition removes both, while failure prevents a success result; no external installation was run here. Is this the best way to solve the issue? Yes: retirement follows validation and restart work, and a retirement failure becomes a non-success result; a shared transaction layer would not fit the Bash, PowerShell, and TypeScript owner boundaries. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2a469c1cb2e1. 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
HistoryReview history (7 earlier review cycles)
|
64d455d to
1a48dda
Compare
|
Land-ready evidence for
Focused local proof included:
Known unrelated gap: the broader optional |
265eec6 to
c4c72e7
Compare
Standalone installers now apply npm-version-aware lifecycle approval. Updates verify and repair the installation before reporting success and preserve the prior install owner during method switches. Uninstall now exits nonzero when requested cleanup is only partially completed. Plugin update behavior is unchanged. Closes #125925
c4c72e7 to
301660d
Compare
|
Merged via squash.
|
…law#125992) * fix(install): make lifecycle mutations transactional Standalone installers now apply npm-version-aware lifecycle approval. Updates verify and repair the installation before reporting success and preserve the prior install owner during method switches. Uninstall now exits nonzero when requested cleanup is only partially completed. Plugin update behavior is unchanged. Closes openclaw#125925 * test(uninstall): assert aggregated live-owner failure * fix(install): satisfy standalone shell checks * fix(update): scan PATH for prior Git wrapper * test(hooks): await Gmail watcher descendant exit * fix(install): verify Windows npm candidate * fix(ci): normalize package acceptance version * fix(update): preserve staged local package links * test(update): fold staged symlink coverage * fix(update): retire every legacy Git wrapper * test(docs): align consolidated ownership checks
Closes #125925
AI-assisted change; implementation, tests, and final diff were reviewed before publication.
What Problem This Solves
Fixes an issue where users installing, updating, switching install methods, or uninstalling OpenClaw could receive a success result even though required npm lifecycle work was skipped, Doctor repair failed, the previous working install was removed before its replacement succeeded, or requested cleanup only partially completed.
Why This Change Was Made
The lifecycle is now one canonical prepare → verify → activate → retire → report-success flow. Standalone installers apply npm-version-aware lifecycle approval and verify the package guard is gone; upgrades run Doctor repair before success; install-method transitions preserve and restore the previous owner until the candidate is verified; updater output is delayed until convergence and restart health; and uninstall aggregates every permitted requested cleanup outcome into one final exit status. Plugin-update behavior is intentionally unchanged.
Because standalone installer ordering is public and upgrade-sensitive, this change includes failure-injection coverage across the Bash, rootless, PowerShell, CLI updater, and uninstall boundaries, plus an artifact-bound npm 12 Package Acceptance lane.
User Impact
npm 12 installs reliably run OpenClaw's required lifecycle scripts. Failed upgrades and install-method switches keep the prior runnable installation instead of stranding the operator. Doctor and partial-uninstall failures now produce a truthful nonzero result, and success is shown only after the requested lifecycle work has actually completed.
Evidence
node scripts/run-vitest.mjs test/scripts/install-sh.test.ts test/scripts/install-cli.test.ts test/scripts/install-ps1.test.ts— 238 tests passed.node scripts/run-vitest.mjs src/commands/uninstall.test.ts src/commands/cleanup-utils.test.ts— 48 tests passed.node scripts/run-vitest.mjs src/cli/update-cli.test.ts src/cli/update-cli/update-command-post-update.test.ts src/infra/package-update-steps.test.ts— 274 tests passed.node scripts/run-vitest.mjs test/scripts/package-acceptance-workflow.test.ts— 194 tests passed.bash -n scripts/install.sh scripts/install-cli.shand PowerShell parser validation forscripts/install.ps1passed.oxfmt, workflow checks, three TypeScript lanes, core/scripts lint, docs MDX validation, andgit diff --checkpassed.install.sh: https://github.com/openclaw/openclaw/actions/runs/32209442257/job/95941005292update-channel-switch: https://github.com/openclaw/openclaw/actions/runs/32209442257/job/95941846850Proof gap: no physical native Windows host was used locally; executable
pwshcoverage and exact-head Windows CI passed. The broader optionalupgrade-survivoracceptance fixture has a canonical in-flight fix in #126000; the task-relevant exact-head custom profile is green.