Skip to content

fix(update): prevent runtime recovery from replacing another install - #150526

Merged
steipete merged 10 commits into
mainfrom
upd/update-engine-preflight
Sep 17, 2026
Merged

steipete merged 10 commits into
mainfrom
upd/update-engine-preflight

Conversation

@steipete

@steipete steipete commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Related: #150452 (item 1)

What Problem This Solves

Fixes unclear update failures and recovery instructions that can lose the CLI or overwrite another deployment after switching Node runtimes.

User Impact

Operators receive a typed permission failure with the affected directory, owner when available, and remediation. Container redeployment advice and pending-recovery constraints remain composed with those facts. Runtime guidance selects a Node release satisfying both the candidate and updater requirements.

After selecting Node, recovery now continues with node <retained-absolute-install>/openclaw.mjs update --tag <candidate>. It preserves the recorded service/state selectors and does not depend on the switched prefix having an openclaw command. The ordinary updater rechecks the selected npm prefix and service ownership before installation. Only a positively inspected empty or owned destination may continue. A foreign or uninspectable destination yields global-install-foreign-destination before staging; the retained installation and destination are preserved. An unknown result names the permission, prefix-probe, or layout cause, and marks the prefix unresolved when npm could not identify it. The updater retains its original installation owner.

For a known foreign destination, the refusal names the occupied prefix, package, launcher, and selected service entrypoint when available. For an unknown destination, it directs the operator to restore inspection access or npm prefix discovery, or ask the deployment owner to verify and explicitly select the intended installation. It offers switching the runtime back and retrying through the retained launcher, or explicitly selecting the other installation with its owner's agreement. An explicit service-selection command is printed only for an observed destination launcher and supported service-management context; wrappers and unresolved launchers remain with the deployment owner. This is not automatic takeover authority.

Why This Change Was Made

The original updater could present raw npm errors and lose a final retry's permission outcome because consumers selected the first failed step. The package owner now records the authoritative outcome, and staging, recovery guidance, reports, and Doctor consume it. Existing reason, failure-fact, and next-action fields carry the diagnostics; no config, CLI/environment option, dependency, or database schema was added.

The runtime-switch follow-up removes preprinted package-install, service-rewrite, restart, and verification commands. Those operations remain with the ordinary updater after fresh admission. The npm prefix query and Windows launcher reader remain shared in update-npm-prefix.ts. Complete filesystem inspection and service/root ownership classification now live together in update-command-package-destination.ts, returning a closed owned | empty | foreign | unknown result. The nullable inspection and its admitting branch were removed without compatibility re-exports. Only owned and empty pass; unknown carries a cause and uses the existing refusal/report path. Service comparison reuses the existing native ownership verdict and launcher/root comparison.

Against b57f4bd588d5ef6e4be1e64b01adbbf17461c12e, cumulative production is +390/-256 (+134), tests/support +501/-158 (+343), and docs +29/-21 (+8). The production growth provides typed permission/destination diagnostics and usable runtime recovery, including fresh-profile runtime selection while preserving service selectors, credentials, and other PATH entries. The unknown-admission repair itself is production-net-zero against 3b5925cab1533cac0e974b9293539a52f6144238 (+98/-98): it combines the former filesystem projection and ownership decision instead of adding another mechanism. Its tests/support are +150/-46 (+104), and docs +8/-3 (+5). Extracting the existing command-transport fixture shrinks the capped CLI test file without removing coverage. All line-cap checks pass without suppression or baseline edits.

Thanks to @arrobapontocom-ui for the field report.

Evidence

  • Before the repair, the real runtime-preflight owner emitted an unconditional npm install -g [email protected] after nvm selection. Real offline npm then replaced a synthetic foreign deployment at the selected prefix while leaving the original prefix unchanged.
  • After the repair, the same owner emits a typed continue-update step through the retained absolute launcher. The real npm-prefix probe returns global-install-foreign-destination and preserves both synthetic packages. Regression coverage exercises this order, dry-run and mutable refusal, empty and owned destinations, a destination claimed by the selected service, and a dangling foreign launcher.
  • Failed-observation regressions exercise the actual continuation boundary: EACCES, EPERM, failed/empty/relative prefix output, and unreadable layout must refuse in dry-run and mutable paths without staging or installation. Positively inspected empty, owned, and service-claimed destinations retain their flow. Final validation is listed below.
Isolated foreign-prefix proof
Before:
pre-switch recovery: nvm install 26.1.0 && nvm use 26.1.0
next step: npm install -g [email protected]
selected prefix CLI: foreign-deployment version=2026.8.1 Node=26.8.2
after unguarded offline npm install: candidate-deployment version=2026.9.4 Node=26.8.2

After:
next step: node <old-prefix>/lib/node_modules/openclaw/openclaw.mjs update --tag 2026.9.4
post-switch preflight: global-install-foreign-destination
selected prefix CLI after refusal: foreign-deployment version=2026.8.1 Node=26.8.2
no install emitted or performed; original and foreign prefixes unchanged

The fixture uses real npm, existing trusted Node executables, isolated prefixes/HOME/state/config/cache, empty npmrc files, and local bin-only package tarballs with lifecycle scripts disabled. It substitutes the local candidate tarball for the registry spec. It exercises prefix switching and the real preflight owner; it does not execute nvm itself, install a real OpenClaw release, or activate a managed service. Fixtures were removed afterward.

Published-driver compatibility and limitations

Current main already checks known candidate engine mismatches before staging. The 2026.7.1-2 driver's silent metadata skip and dry-run bypass are shipped-driver behavior; candidate code cannot retroactively change them. The new guidance and prefix refusal require the fixed updater to be installed.

Prior proof ran untouched published [email protected] (3a9d69d) under Node 24.21.0 in a disposable container with isolated HOME/state and a root-owned prefix. Its dry-run exited 0 without permission failures because it returns before candidate execution. This is an installed-driver limitation.

A synthetic terminal row using the existing schema-17 reason, step, and origin.nextAction fields was then read successfully by that published driver's JSON and human update-status paths. They preserved the new permission reason, directory, owner, and full remediation; unknown structured facts did not remove stored data. This proves existing report-record compatibility, not old-driver production of new outcomes or a full activation. No schema change is introduced by this follow-up. No Gateway or real operator state was changed.

ClawSweeper follow-up: the foreign-prefix finding is addressed by the retained-launcher continuation and fresh destination admission. The PowerShell 5.1 rank-up move is applied: nvm/fnm selection uses an explicit LASTEXITCODE condition on Windows, and the old && verification chain is removed. Native PowerShell 5.1, nvm, and managed-service activation were not available/executed on this host; the PR makes no live proof claim for them. Doctor's added reason handling is advisory use of existing history fields, not a data-model migration.

Rebased validation on 8a31544611cd37b0eab5f3264ebb2158a52ab62c (base 5ac1b2e17ebfac7d7326959b695a6d4edf1b0207):

  • Mechanical conflict only in src/cli/update-cli.test.ts: preserved main's before/after exit-code cleanup and the isolated npm-prefix fixture, while retaining main's comment removal. No production hunk conflicted or changed. Nine range-diff entries are =; the final ! is context-only. Its zero-context added/deleted patch content is identical before and after rebase.
  • pnpm install --frozen-lockfile: passed.
  • OPENCLAW_VITEST_MAX_WORKERS=1 pnpm test src/cli/update-cli src/cli/update-cli.test.ts: 2,085 passed, 6 skipped, including all 504 top-level CLI integration cases. Full runtime build prerequisite passed. No focused fallback needed.
  • node scripts/check-changed.mjs: all steps before lint passed, including every typecheck lane. Lint hit only the documented ancestor-node_modules declaration artifact. The approved direct extension lint passed after a fresh canary; independent core/script lint and stylesheet lint passed. Both runtime and Madge checks report 0 cycles.
  • Fresh committed-branch Codex autoreview (--mode branch --base origin/main --max-priority P1): scoped-clean, exit 0. Artifact: pr-150526-r10-autoreview.md.
  • Exact-head pull_request CI run 35256901883 attached. The native watcher stopped at its first terminal result: GREEN, exit 0, 0 pending, 6 superseded checks excluded. Raw GitHub rollup still said FAILURE from superseded checks; the native exact-head verdict was GREEN. No CI rerun or landing was performed.
Fresh extension-lint canary (exit 1; removed):
node_modules/.bin/oxlint --tsconfig test/tsconfig/tsconfig.extensions.test.json extensions/l520-r10-lint-canary.ts
error eslint(no-unused-vars): Variable 'l520UnusedCanary' is declared but never used.
error unicorn(require-module-specifiers): Empty export specifier is not allowed.

Real extension tree (exit 0):
node_modules/.bin/oxlint --tsconfig test/tsconfig/tsconfig.extensions.test.json extensions
Existing max-lines warnings: memory-core manager 701; Slack dispatch 703; Codex index test 1031.

Prior accepted-head validation on 48f6112a3fb2de2c4d7e4720bcf6540078c6085f:

  • Before the production fix, the new EACCES, EPERM, and failed-prefix cases produced 3 failures / 6 passes: the continuation resolved instead of refusing. The final 12-case destination boundary covers all four result kinds and all three unknown causes, including successful-but-empty/relative probe output, with exact refusal text and no staging/install assertions.
  • OPENCLAW_VITEST_MAX_WORKERS=1 pnpm test src/cli/update-cli: 1,576 passed, 6 skipped across three projects. Its full build prerequisite also completed.
  • After extracting the transport fixture and finalizing refusal wording, the full top-level CLI integration file plus destination, continuation, npm global-probe, and Doctor tests passed 544 tests (517 CLI, 24 infrastructure, 3 commands). This includes all 504 top-level CLI cases.
  • node scripts/check-changed.mjs --base 3b5925cab1533cac0e974b9293539a52f6144238: exit 0, covering production/test types, targeted lint, formatting, boundaries, ratchets, schema/storage guards, and dead-export checks. Runtime import cycles and Madge both report 0 cycles.
  • Fresh committed-branch Codex review: --mode branch --base origin/main --max-priority P1, scoped-clean, exit 0. Artifact: pr-150526-r9-autoreview.md.
  • That old head stopped at CONFLICTING with no attached pull_request run. The rebase below replaces it; the saved run was not rerun.
  • Real permission proof used the production inspection owner and a real npm prefix query under isolated HOME/state/config/cache. Denying access to a synthetic destination's node_modules returned unknown / permission; restoring permissions confirmed both original and destination marker files unchanged. The fixture was removed. This complements the CLI no-staging regression; it does not claim live Gateway activation or a real package installation.
kind: unknown
cause: permission
reason: global-install-foreign-destination
original marker: preserved
destination marker: preserved

Selected npm destination <fixture>/selected-prefix could not be inspected
(permission); ownership is unknown. No installation was attempted.
Fix inspection permissions on this prefix for the service account, or make
`npm prefix -g` succeed with the selected runtime, then run
`node <fixture>/retained-install/openclaw.mjs --profile l520-permission-proof update`.
Alternatively, ask the deployment owner to verify the layout and explicitly
select the intended installation using its existing deployment procedure.

The earlier full production changed checks passed all type and pre-lint gates; native extension lint reached only the documented nested-checkout declaration-input artifact. The approved direct extension lint, independent core/script lint, stylesheet lint, and runtime-cycle check passed. No baseline or suppression was changed.

Approved extension-lint substitute
Saved canary with unchanged lint configuration (exit 1):
node_modules/.bin/oxlint --tsconfig test/tsconfig/tsconfig.extensions.test.json extensions/l520-continuation-lint-canary.test.ts
error eslint(no-unused-vars): Variable 'l520UnusedContinuationCanary' is declared but never used.
error unicorn(require-module-specifiers): Empty export specifier is not allowed.
Canary removed.

Real extension tree, rerun on this head (exit 0):
node_modules/.bin/oxlint --tsconfig test/tsconfig/tsconfig.extensions.test.json extensions
Unchanged max-lines warnings: memory-core manager 701; Slack dispatch 703; Codex index test 1031.

CI's extension-lint job remains authoritative.

@clawsweeper

clawsweeper Bot commented Sep 17, 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 commands Command implementations labels Sep 17, 2026
@steipete
steipete marked this pull request as ready for review September 17, 2026 02:47
@openclaw-barnacle openclaw-barnacle Bot added size: L maintainer Maintainer-authored PR labels Sep 17, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 17, 2026
@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 17, 2026, 2:44 PM ET / 18:44 UTC (Revision 16).

ClawSweeper review

What this changes

The updater adds actionable runtime and permission diagnostics and resumes runtime recovery through the original launcher with fresh installation-ownership checks.

Merge readiness

⛔ Blocked before merge - 5 items remain

This PR remains useful and has convincing destination-refusal proof, but both prior P2 findings remain unresolved in the pinned head.

Priority: P2
Reviewed head: 8a31544611cd37b0eab5f3264ebb2158a52ab62c

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful ownership-focused repair with strong bounded runtime proof, held back by two unresolved source-proven findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The matching full PR body records the production runtime-preflight and destination-inspection owners using real npm in isolated prefixes, with foreign and inaccessible destinations refused and both installations preserved. Published-driver report compatibility is separately demonstrated; actual nvm and managed-service activation are explicitly outside this proof.
Patch quality 🦐 gold shrimp (3/6) 2 actionable review findings remain.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The matching full PR body records the production runtime-preflight and destination-inspection owners using real npm in isolated prefixes, with foreign and inaccessible destinations refused and both installations preserved. Published-driver report compatibility is separately demonstrated; actual nvm and managed-service activation are explicitly outside this proof.
Evidence reviewed 8 items Recovery still drops channel selection: The introduced continuation always emits update --tag for package installs and accepts no effective/requested channel. The target resolver rejects explicit tags with extended-stable, and channel persistence requires the requested channel. Existing integration cases cover these contracts.
Existing extended-stable contract: The resolver refuses extended-stable plus an explicit tag before selecting a package. Integration tests cover both stored and explicit extended-stable channels; documentation says successful --channel selection persists the subscription.
Windows expectations remain incompatible: The unconditionally executed service-plan tests expect export/unset context commands, while resolveServiceRecoveryContext emits PowerShell environment assignments and Remove-Item on Windows. The shared expectedPlainRecovery and expectedManagedRuntimeRecoverySteps fixtures also retain unconditional unset expectations.
Findings 2 actionable findings [P2] [P2] Preserve the extended-stable channel in recovery commands
[P2] [P2] Make recovery-context expectations valid on Windows
Security None None.

How this fits together

OpenClaw’s updater combines the selected release, Node runtime, package-manager destination, and managed Gateway configuration before installing a candidate. Its recovery instructions and recorded outcomes guide operators and Doctor after a failed attempt.

flowchart TD
  A[Selected release and saved channel] --> C[Update preflight]
  B[Node runtime and service configuration] --> C
  C --> D[Inspect installation destination]
  D --> E[Owned or empty destination]
  D --> F[Foreign or unknown destination]
  E --> G[Normal installation and verification]
  F --> H[Retained launcher recovery and Doctor report]
Loading

Before merge

  • [P2] Preserve the extended-stable channel in recovery commands (P2) - This prior finding remains unresolved. For a saved update.channel: "extended-stable", the generated update --tag &lt;version> is rejected by update-command-target.ts:165, so following recovery still fails after Node is repaired. An explicitly requested channel is also omitted before it can be persisted. Carry effective/requested channel selection into recovery, using the existing verified extended-stable selector without --tag.
  • [P2] Make recovery-context expectations valid on Windows (P2) - This prior finding remains unresolved. These tests run on Windows but expect POSIX export/unset, while resolveServiceRecoveryContext correctly emits PowerShell assignments and Remove-Item. The same mismatch remains in the recorded-selector case and shared runtime-recovery fixtures used by CLI tests. Make those expectations platform-specific so the affected Windows tests can pass without changing correct production shell output.
  • Resolve merge risk (P1) - Existing npm updates can now refuse foreign or uninspectable selected prefixes and require operator correction; the recorded proof covers refusal and report compatibility, but not full native runtime-manager and managed-service activation.
  • Complete next step (P2) - Preserve channel selection in generated recovery commands and correct the Windows recovery-context expectations, then validate both affected paths.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.

Findings

  • [P2] [P2] Preserve the extended-stable channel in recovery commands — src/cli/update-cli/update-command-service-plan.ts:394-397
  • [P2] [P2] Make recovery-context expectations valid on Windows — src/cli/update-cli/update-command-service-plan.test.ts:163-165
Agent review details

Security

None.

PR surface

Source +662, Tests +1121, Docs +76, Other +3. Total +1862 across 54 files.

View PR surface stats
Area Files Added Removed Net
Source 26 1152 490 +662
Tests 23 1320 199 +1121
Docs 3 76 0 +76
Config 0 0 0 0
Generated 0 0 0 0
Other 2 8 5 +3
Total 54 2556 694 +1862

Review metrics

Metric Value Why it matters
Production versus test growth Production +665 net; tests/support +1121 net The introduced delta adds typed recovery and destination diagnostics; the PR explains the production growth and consolidates existing ownership helpers.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/commands/doctor-update-run.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Preserve channel intent through recovery (recommended)
    Carry channel selection into the retained-launcher continuation and validate saved and explicit extended-stable recovery without weakening destination admission.

Technical review

Best possible solution:

Keep recovery within the ordinary updater, preserving channel intent and service selectors while retaining destination ownership checks and platform-correct instructions.

Do we have a high-confidence way to reproduce the issue?

Yes, source establishes both remaining failures: generated --tag recovery meets the extended-stable rejection, and Windows production output disagrees with unconditional POSIX test expectations. No target code or tests were executed during this read-only review.

Is this the best way to solve the issue?

Yes, resuming through the retained launcher and existing updater is the appropriate ownership boundary; channel propagation and platform-specific expectations still need correction.

Full review comments:

  • [P2] [P2] Preserve the extended-stable channel in recovery commands — src/cli/update-cli/update-command-service-plan.ts:394-397
    This prior finding remains unresolved. For a saved update.channel: "extended-stable", the generated update --tag &lt;version> is rejected by update-command-target.ts:165, so following recovery still fails after Node is repaired. An explicitly requested channel is also omitted before it can be persisted. Carry effective/requested channel selection into recovery, using the existing verified extended-stable selector without --tag.
    Confidence: 0.99
  • [P2] [P2] Make recovery-context expectations valid on Windows — src/cli/update-cli/update-command-service-plan.test.ts:163-165
    This prior finding remains unresolved. These tests run on Windows but expect POSIX export/unset, while resolveServiceRecoveryContext correctly emits PowerShell assignments and Remove-Item. The same mismatch remains in the recorded-selector case and shared runtime-recovery fixtures used by CLI tests. Make those expectations platform-specific so the affected Windows tests can pass without changing correct production shell output.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against ecc4c992fb1b.

Labels

Label justifications:

  • P2: This is a bounded updater reliability improvement with remaining recovery and platform-test defects.
  • merge-risk: 🚨 compatibility: Generated recovery fails for saved extended-stable configurations, and the new destination admission can require operator correction before existing updates proceed.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (terminal): The matching full PR body records the production runtime-preflight and destination-inspection owners using real npm in isolated prefixes, with foreign and inaccessible destinations refused and both installations preserved. Published-driver report compatibility is separately demonstrated; actual nvm and managed-service activation are explicitly outside this proof.
  • proof: sufficient: Contributor real behavior proof is sufficient. The matching full PR body records the production runtime-preflight and destination-inspection owners using real npm in isolated prefixes, with foreign and inaccessible destinations refused and both installations preserved. Published-driver report compatibility is separately demonstrated; actual nvm and managed-service activation are explicitly outside this proof.

Evidence

What I checked:

  • Recovery still drops channel selection: The introduced continuation always emits update --tag for package installs and accepts no effective/requested channel. The target resolver rejects explicit tags with extended-stable, and channel persistence requires the requested channel. Existing integration cases cover these contracts. (src/cli/update-cli/update-command-service-plan.ts:394, 8a31544611cd)
  • Existing extended-stable contract: The resolver refuses extended-stable plus an explicit tag before selecting a package. Integration tests cover both stored and explicit extended-stable channels; documentation says successful --channel selection persists the subscription. (src/cli/update-cli/update-command-target.ts:165, 8a31544611cd)
  • Windows expectations remain incompatible: The unconditionally executed service-plan tests expect export/unset context commands, while resolveServiceRecoveryContext emits PowerShell environment assignments and Remove-Item on Windows. The shared expectedPlainRecovery and expectedManagedRuntimeRecoverySteps fixtures also retain unconditional unset expectations. (src/cli/update-cli/update-command-service-plan.test.ts:165, 8a31544611cd)
  • Positive destination admission: The destination owner distinguishes owned, empty, foreign, and unknown results. The target resolver admits only owned or empty; boundary tests cover permission errors, failed/empty/relative prefix probes, unreadable layouts, and preservation before staging. (src/cli/update-cli/update-command-package-destination.ts:20, 8a31544611cd)
  • Full proof body inspected: The complete 13,938-unit PR body was read through GitHub; its SHA-256 matches the supplied snapshot, 0f0cb4e939a63396fd8e2ca0cd873e1d21d925ada19f04d238ca381d1a517f63. It records real npm and production-preflight observations preserving original and foreign synthetic installations, plus a real permission-denial inspection. Published v2026.9.4 read the new diagnostics through existing history fields. The body explicitly excludes actual nvm execution and managed-service activation. (8a31544611cd)
  • Still necessary on current main: Fetched main retains the older runtime-recovery advice to install openclaw@latest after switching Node; it does not contain this retained-launcher recovery implementation. (src/cli/update-cli/update-command-service-plan.ts, ecc4c992fb1b)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • RomneyDa: 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.

  • Exercise generated recovery with saved and explicitly selected extended-stable channels.
  • Correct platform-specific context expectations and validate the affected Windows tests.

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.

History

Review history (15 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-17T10:06:40.498Z sha ee94bea :: blocked before merge. :: [P2] Preserve CLI availability after switching nvm versions
  • reviewed 2026-09-17T12:21:56.205Z sha b57f4bd :: blocked before merge. :: [P2] Render recovery commands for Windows PowerShell 5.1
  • reviewed 2026-09-17T14:23:52.945Z sha 51367f5 :: blocked before merge. :: [P2] Preserve the extended-stable channel in recovery commands | [P2] Move the command-runner type into a leaf contract | [P2] Make recovery-context expectations valid on Windows
  • reviewed 2026-09-17T15:04:05.277Z sha 06d7e39 :: blocked before merge. :: [P2] Preserve the extended-stable channel in recovery commands | [P2] Make recovery-context expectations valid on Windows
  • reviewed 2026-09-17T15:18:15.759Z sha 06d7e39 :: blocked before merge. :: [P2] Preserve the extended-stable channel in recovery commands | [P2] Make recovery-context expectations valid on Windows | [P2] Account for the resolved npm launcher in probe expectations
  • reviewed 2026-09-17T15:51:26.602Z sha 3b5925c :: blocked before merge. :: [P2] Preserve the extended-stable channel in recovery commands | [P2] Make recovery-context expectations valid on Windows
  • reviewed 2026-09-17T16:14:51.690Z sha 3b5925c :: blocked before merge. :: [P2] Preserve the extended-stable channel in recovery commands | [P2] Make recovery-context expectations valid on Windows
  • reviewed 2026-09-17T17:38:02.976Z sha 48f6112 :: blocked before merge. :: [P2] Preserve the extended-stable channel in recovery commands | [P2] Make recovery-context expectations valid on Windows

@steipete
steipete force-pushed the upd/update-engine-preflight branch from b5b3102 to 0427ca3 Compare September 17, 2026 04:02
@steipete
steipete force-pushed the upd/update-engine-preflight branch from 0427ca3 to 999d2a8 Compare September 17, 2026 04:34
steipete added a commit that referenced this pull request Sep 17, 2026
Carry the package owner's failedStep through the result adapter instead of
selecting a failure from attempt history. Admission, settlement, and retention
owners record their selected outcomes directly.

Preserve EACCES remediation and facts after an unrelated npm failure and retry.
Thanks to @arrobapontocom-ui for the report in #150452; follow-up to #150526.
@steipete
steipete force-pushed the upd/update-engine-preflight branch from 999d2a8 to d4e4788 Compare September 17, 2026 05:04
steipete added a commit that referenced this pull request Sep 17, 2026
Carry the package owner's failedStep through the result adapter instead of
selecting a failure from attempt history. Admission, settlement, and retention
owners record their selected outcomes directly.

Preserve EACCES remediation and facts after an unrelated npm failure and retry.
Thanks to @arrobapontocom-ui for the report in #150452; follow-up to #150526.
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 17, 2026
@steipete
steipete force-pushed the upd/update-engine-preflight branch from 48d487a to 44d0e3d Compare September 17, 2026 07:10
steipete added a commit that referenced this pull request Sep 17, 2026
Carry the package owner's failedStep through the result adapter instead of
selecting a failure from attempt history. Admission, settlement, and retention
owners record their selected outcomes directly.

Preserve EACCES remediation and facts after an unrelated npm failure and retry.
Thanks to @arrobapontocom-ui for the report in #150452; follow-up to #150526.
@steipete
steipete force-pushed the upd/update-engine-preflight branch from 44d0e3d to 07db59d Compare September 17, 2026 07:19
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 17, 2026
@steipete
steipete force-pushed the upd/update-engine-preflight branch from 48f6112 to 8a31544 Compare September 17, 2026 18:07
@steipete
steipete merged commit 80b9230 into main Sep 17, 2026
217 of 218 checks passed
@steipete
steipete deleted the upd/update-engine-preflight branch September 17, 2026 20:24
@steipete

Copy link
Copy Markdown
Contributor Author

Landing at 8a31544611cd37b0eab5f3264ebb2158a52ab62c with one ClawSweeper finding deliberately deferred, stated here rather than merged past silently:

  • P2 — recovery command uses --tag on a saved extended-stable channel (update-command-service-plan.ts:396 vs the resolver's refusal at update-command-target.ts:165): confirmed. The guidance this PR adds is right for stable, beta and dev and unfollowable for extended-stable, where today there is no guidance at all. The fix belongs in the recovery generator (derive the channel's own selector instead of --tag); it is already written and under test in the same lane and follows as a separate PR immediately after this merges. Deferring it keeps the install-protection change (refusing uninspectable npm destinations, never replacing another install's runtime) from waiting on a guidance-text fix for one channel.

steipete added a commit that referenced this pull request Sep 17, 2026
Preserve saved extended-stable subscriptions and explicit channel switches when a Node runtime refusal prints recovery instructions. Reuse the resolved target and existing service inspection verdict so recovery returns through the retained launcher and normal ownership checks.

Direct protected or pinned service-runtime repairs to the deployment owner, and avoid force-install advice for a service definition that cannot be refreshed. The extended-stable tag refusal and installation ownership protections remain unchanged.

Follow-up to the deferred recovery-command P2 in #150526; related to #150452. Thanks to @arrobapontocom-ui for the original field report.

Validation: exact-head CI run 35275739173 is green with zero pending checks. Recorded update CLI proof passed 2,097 tests with 6 skipped, followed by all 7 channel replay cases; targeted checks passed. The exact-head Codex review is scoped-clean through P2 and ClawSweeper reports no findings. Native runtime switching and managed-service activation were not exercised.
@steipete

Copy link
Copy Markdown
Contributor Author

The deferred P2 is closed: #151150 (merged as 452ab7b86a5281916a20b228532be414315755cc) makes the printed recovery command carry the saved or requested channel and the inspected service constraints, so an extended-stable operator gets a command the resolver accepts; the resolver's --tag refusal on that channel is unchanged.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 18, 2026
CI setup could fail before lint or tests when Matrix crypto native-library downloads hit a transient release-CDN error. Hosted store-only readers used a different cache path from the publisher, and hybrid mode seeded only the Blacksmith Linux backend.

Align the existing setup action and warmer on the workspace-local pnpm store, publish completed native installation outputs before unrelated build work, and add one install-only hosted warmer row in hybrid mode. Bound installed-Node discovery to four levels to avoid traversing bundled npm dependencies. The existing warmer remains the sole publisher and PR consumers remain restore-only.

Current-head hosted warm setup completed in 22 seconds with 1,436 packages reused, zero downloads, and Matrix postinstall skipped, compared with the recorded ten-job 45-second baseline median. This is an observed sample, not a measured fleet-wide median change. Cold caches and changed native inputs still require upstream assets. No application runtime, configuration, dependency, or permission changes.

Validation: exact-head PR CI run 35197161825 returned GREEN; the accepted Codex review and exact-head ClawSweeper review found no actionable issues. The PR also records passing targeted Node/cache guards, workflow checks, and cold/warm native reuse proof.

Related: openclaw#150637, openclaw#150526.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 18, 2026
…penclaw#150526)

* fix(update): explain runtime and global install permission failures

Report the affected directory, owner, and next action for npm permission
failures. Preserve typed outcomes in dry-run previews, update reports, and
Doctor history, and give candidate-specific Node upgrade guidance.

Thanks to @arrobapontocom-ui for reporting the upgrade diagnostics in openclaw#150452.

* fix(update): keep the final retry error in staging and guidance

Carry the package owner's failedStep through the result adapter instead of
selecting a failure from attempt history. Admission, settlement, and retention
owners record their selected outcomes directly.

Preserve EACCES remediation and facts after an unrelated npm failure and retry.
Thanks to @arrobapontocom-ui for the report in openclaw#150452; follow-up to openclaw#150526.

* fix(update): preserve deployment advice in permission recovery

* test(update): assert candidate runtime guidance at the CLI boundary

* fix(update): recommend a runtime the updater itself can run

* fix(update): keep the CLI reachable through a runtime switch in recovery guidance

* fix(update): recheck ownership after runtime switches

Continue through the retained absolute launcher instead of recommending an
uninspected global install. Recheck prefix and service ownership, preserve
typed refusal guidance in reports, and keep the selected runtime during
fresh-profile admission.

Thanks to @arrobapontocom-ui for the original report (openclaw#150452, item 1).

* fix(update): isolate the global command runner contract

* test(update): match resolved npm prefix probes

* fix(update): refuse uninspectable npm destinations
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 18, 2026
)

Preserve saved extended-stable subscriptions and explicit channel switches when a Node runtime refusal prints recovery instructions. Reuse the resolved target and existing service inspection verdict so recovery returns through the retained launcher and normal ownership checks.

Direct protected or pinned service-runtime repairs to the deployment owner, and avoid force-install advice for a service definition that cannot be refreshed. The extended-stable tag refusal and installation ownership protections remain unchanged.

Follow-up to the deferred recovery-command P2 in openclaw#150526; related to openclaw#150452. Thanks to @arrobapontocom-ui for the original field report.

Validation: exact-head CI run 35275739173 is green with zero pending checks. Recorded update CLI proof passed 2,097 tests with 6 skipped, followed by all 7 channel replay cases; targeted checks passed. The exact-head Codex review is scoped-clean through P2 and ClawSweeper reports no findings. Native runtime switching and managed-service activation were not exercised.
RomneyDa added a commit that referenced this pull request Sep 22, 2026
CI setup could fail before lint or tests when Matrix crypto native-library downloads hit a transient release-CDN error. Hosted store-only readers used a different cache path from the publisher, and hybrid mode seeded only the Blacksmith Linux backend.

Align the existing setup action and warmer on the workspace-local pnpm store, publish completed native installation outputs before unrelated build work, and add one install-only hosted warmer row in hybrid mode. Bound installed-Node discovery to four levels to avoid traversing bundled npm dependencies. The existing warmer remains the sole publisher and PR consumers remain restore-only.

Current-head hosted warm setup completed in 22 seconds with 1,436 packages reused, zero downloads, and Matrix postinstall skipped, compared with the recorded ten-job 45-second baseline median. This is an observed sample, not a measured fleet-wide median change. Cold caches and changed native inputs still require upstream assets. No application runtime, configuration, dependency, or permission changes.

Validation: exact-head PR CI run 35197161825 returned GREEN; the accepted Codex review and exact-head ClawSweeper review found no actionable issues. The PR also records passing targeted Node/cache guards, workflow checks, and cold/warm native reuse proof.

Related: #150637, #150526.

Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes commands Command implementations docs Improvements or additions to documentation maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant