Skip to content

fix(update): replace unsupported Gateway service Node runtimes - #143159

Merged
steipete merged 2 commits into
mainfrom
steipete/upd-node-runtime
Sep 9, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/upd-node-runtime

Conversation

@steipete

@steipete steipete commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Refs #107930

What Problem This Solves

Fixes an issue where users running openclaw gateway install after upgrading Node could be told the service was already installed while its recorded Node executable was unsupported. A macOS field report described Homebrew Node 26.8.1 and OpenClaw 2026.9.3 installed successfully while the LaunchAgent still referenced another tool's Node 22.23.1; forcing a reinstall recovered the Gateway.

The contradictory update-preflight guidance is already repaired on this base by #142322 (thanks @SunnyShu0925). This change adds explicit coverage for Node 22.23.2, 24.15.0, 25.9.0, and 26.0.0 against the target package's engine range.

Why This Change Was Made

The shared Gateway install command now probes the recorded Node with the existing runtime classifier and treats an unsupported executable as a required refresh. Repair prefers the supported running CLI Node, retaining stable Homebrew paths, then uses the existing supported-system-node selection. The chosen runtime goes through the normal service install plan. Supported services, explicit wrappers, Bun selection, and service-definition ownership rules retain their existing behavior.

POSIX installer refreshes retain a fixed confirmation that Node was replaced after installation succeeds, while continuing to suppress incidental child output and runtime paths. Failed refreshes cannot report a successful runtime replacement.

User Impact

Missing or non-executable recorded Node binaries now trigger the same supported-runtime replacement, while genuine probe failures on an existing executable retain an actionable openclaw gateway install --force hint.

Users can repair a stale unsupported service Node by running openclaw gateway install from a supported Node without adding --force. Installer and update refreshes share that repair. Genuine probe failures and missing supported replacements produce actionable errors instead of an already-installed result.

Evidence

  • Regressions fail against the original code: both non-force platform cases skip installation; forced cases omit the replacement notice; the resolver selects system Node instead of the requested supported CLI; both POSIX installers suppress the confirmation. The four version-guidance cases also fail with the diagnostic hunk from fix(update): correct misleading Node compatibility guidance #142322 reverted.
  • Source owner suites pass: 71 runtime-selector tests, 94 install/unit/integration tests on the final repair, and 8 target-package preflight tests.
  • POSIX installer suites pass: 192 install.sh tests and 106 install-cli.sh tests, including success, failed refresh, output filtering, and no duplicate restart.
  • node scripts/check-changed.mjs: passed, including production/test typechecks, lint, ratchets, unused-export scans, and runtime/security boundary guards. git diff --check and Bash syntax checks pass.

The definition fixtures use the real install plan and serializers, temporary files, a simulated obsolete Node, and the real supported CLI Node. Native service managers were not started. Windows-specific installer forwarding is outside this patch; PowerShell execution was unavailable locally. The broader preference question for an already-supported private Node in #107930 remains open. Maintainer review and landing are pending.

Compatibility evidence: this PR changes no SQLite schema, persisted user-data format, or store retention/recovery rules and introduces no service-definition format. Existing readers decode the recorded launchd/systemd definitions and the normal install plan writes their replacements. Upgrade fixtures cover unsupported, missing, and non-executable recorded Node paths with and without force, verify the Gateway entrypoint is retained, and keep supported-runtime, explicit-wrapper, genuine-probe-error, and definition-ownership controls covered. No database migration or backfill is needed.

Follow-up validation: eight missing/non-executable definition cases failed before repair and pass afterward; malformed-version and missing-notice regressions also fail before/pass after. All 173 requested owner tests, six focused installer-notice cases, and node scripts/check-changed.mjs pass. Independent follow-up autoreview is clean at P0/P1. Hosted CI is green for f8066edee26fd9208464b8863ed0e956c187ca88: https://github.com/openclaw/openclaw/actions/runs/34366200361. No rerun was needed on this head.

Treat unsupported recorded Node versions as a required service refresh,
prefer the supported CLI runtime, and preserve existing force and ownership
boundaries. Report successful Node replacement through POSIX installers
without exposing incidental child output.

Cover launchd/systemd definition repair and the target-engine guidance
already corrected by #142322.

Refs #107930
@clawsweeper

clawsweeper Bot commented Sep 9, 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.

@steipete
steipete marked this pull request as ready for review September 9, 2026 14:13
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime cli CLI command changes scripts Repository scripts size: M maintainer Maintainer-authored PR labels Sep 9, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. 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. labels Sep 9, 2026
@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 9, 2026, 10:58 AM ET / 14:58 UTC (Revision 3).

ClawSweeper review

What this changes

The PR refreshes managed Gateway services whose recorded Node executable is unsupported, missing, or non-executable, and reports successful replacement through POSIX installers.

Merge readiness

⛔ Blocked before merge - 1 item remains

This remains a useful, bounded repair absent from the inspected main and release. No blocking patch defect was found; the previous native-service proof concern does not establish an additional merge gate for this maintainer-authored change.

Priority: P1
Reviewed head: f8066edee26fd9208464b8863ed0e956c187ca88

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with meaningful boundary coverage and no supported blocking finding; native activation is not claimed as tested.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied repository state identifies a maintainer-authored PR, so the external-contributor proof gate does not apply. Definition fixtures exercise the install plan and serializers with a real supported CLI Node, but do not prove native activation; no material authority change requires a separate final-effect proof gate.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied repository state identifies a maintainer-authored PR, so the external-contributor proof gate does not apply. Definition fixtures exercise the install plan and serializers with a real supported CLI Node, but do not prove native activation; no material authority change requires a separate final-effect proof gate.
Evidence reviewed 8 items Current main still lacks automatic install repair: The pinned main installer reaches its already-installed result without checking the recorded Node version or executable availability. Existing updater preflight can substitute a compatible runtime during package updates, but does not cover this direct gateway-install entrypoint.
Latest supplied release has the same gap: The v2026.9.3 installer likewise checks existing refresh reasons without probing the recorded Node executable; this repair is not present in that release.
Repair preserves the existing install boundary: The introduced branch checks only recorded Node commands without an explicit wrapper, selects a replacement through the existing resolver, and passes runtimePath into the normal install plan. Supported Node versions remain unchanged without force; genuine probe failures produce actionable errors. Definition-writability checks remain ahead of installation.
Findings None None.
Security None None.

How this fits together

The Gateway service installer converts CLI options and existing service settings into a native service definition. Its runtime selector chooses the Node executable that will run the Gateway after installation.

flowchart TD
  A[Gateway install or installer refresh] --> B[Read existing service]
  B --> C[Check recorded Node]
  C --> D[Keep supported runtime]
  C --> E[Select supported replacement]
  E --> F[Check service ownership]
  F --> G[Install service definition]
  G --> H[Report installation outcome]
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +66, Tests +268, Docs +1, Other +8. Total +343 across 11 files.

View PR surface stats
Area Files Added Removed Net
Source 2 71 5 +66
Tests 6 318 50 +268
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 2 10 2 +8
Total 11 400 57 +343

Review metrics

Metric Value Why it matters
Production versus test growth Production +74 net lines; tests +268 net lines Production growth implements runtime diagnosis and replacement reporting; the larger test addition covers repair and preservation paths.

Stored data model

Persistent data-model change detected: migration/backfill/repair: scripts/install-cli.sh, migration/backfill/repair: scripts/install.sh. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep runtime repair in the shared installer, preserving supported runtimes, wrappers, service ownership, and existing settings through the canonical install plan.

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

Yes, from source: an otherwise current loaded service pointing at an unsupported Node can return already-installed on main without runtime repair. The PR reports failing-before regression coverage; this read-only review did not execute it.

Is this the best way to solve the issue?

Yes. Reusing the existing runtime selector and service-install plan addresses the direct install gap without changing supported private-runtime preference or provisioning Node globally.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P1: The reported stale service runtime prevents the Gateway from recovering after an otherwise successful Node and OpenClaw upgrade.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied repository state identifies a maintainer-authored PR, so the external-contributor proof gate does not apply. Definition fixtures exercise the install plan and serializers with a real supported CLI Node, but do not prove native activation; no material authority change requires a separate final-effect proof gate.

Evidence

What I checked:

  • Current main still lacks automatic install repair: The pinned main installer reaches its already-installed result without checking the recorded Node version or executable availability. Existing updater preflight can substitute a compatible runtime during package updates, but does not cover this direct gateway-install entrypoint. (src/cli/daemon-cli/install.ts:272, 4b9ff9dd206b)
  • Latest supplied release has the same gap: The v2026.9.3 installer likewise checks existing refresh reasons without probing the recorded Node executable; this repair is not present in that release. (src/cli/daemon-cli/install.ts, 1391f7cd2d40)
  • Repair preserves the existing install boundary: The introduced branch checks only recorded Node commands without an explicit wrapper, selects a replacement through the existing resolver, and passes runtimePath into the normal install plan. Supported Node versions remain unchanged without force; genuine probe failures produce actionable errors. Definition-writability checks remain ahead of installation. (src/cli/daemon-cli/install.ts:280, f8066edee26f)
  • Runtime probe and security boundary: The new recorded-Node probe reuses the existing five-second runtime probe with an allowlisted environment that excludes service secrets and NODE_OPTIONS. Replacement does not introduce a new principal, persisted authorization value, dependency, download, or privilege mechanism. (src/daemon/runtime-paths.ts:273, f8066edee26f)
  • Boundary validation and its limits: The supplied complete PR body describes failing-before regressions and passing owner suites. Introduced tests cover launchd/systemd definition rewriting for unsupported, missing, and non-executable Node, with and without force; supported-runtime preservation; failed probes; unavailable replacements; and denied definition mutation. Installer tests retain output filtering and prevent success notices after failure. Native managers were not started, and this review executed no target tests. (src/cli/daemon-cli/install.integration.test.ts:161, f8066edee26f)
  • Related work remains distinct: The supplied GitHub context verifies fix(update): correct misleading Node compatibility guidance #142322 as merged and limited to compatibility guidance. [Feature]: Improve OpenClaw upgrade experience when Node.js version requirement changes #107930 remains a broader upgrade request; its discussion positively contributes an installed-resolver observation and distinguishes supported private-runtime preference from this unsupported-runtime repair.

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vitor Cepeda Lopes: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (2 earlier review cycles)
  • reviewed 2026-09-09T14:20:33.468Z sha 15b01d5 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-09T14:32:01.132Z sha 15b01d5 :: blocked before merge. :: none

Recover missing or non-executable recorded Node paths through the existing
supported-runtime selection and service install plan. Keep genuine probe
failures actionable with the recorded path and a force-install hint, and
recognize the missing-runtime notice in the POSIX installers.

Refs #107930
@steipete

steipete commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete
steipete merged commit fe79d36 into main Sep 9, 2026
197 checks passed
@steipete
steipete deleted the steipete/upd-node-runtime branch September 9, 2026 15:26
@steipete

steipete commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 10, 2026
…law#143159)

* fix(update): replace unsupported Gateway service Node runtimes

Treat unsupported recorded Node versions as a required service refresh,
prefer the supported CLI runtime, and preserve existing force and ownership
boundaries. Report successful Node replacement through POSIX installers
without exposing incidental child output.

Cover launchd/systemd definition repair and the target-engine guidance
already corrected by openclaw#142322.

Refs openclaw#107930

* fix(daemon): replace missing Gateway service Node on install

Recover missing or non-executable recorded Node paths through the existing
supported-runtime selection and service install plan. Keep genuine probe
failures actionable with the recorded path and a force-install hint, and
recognize the missing-runtime notice in the POSIX installers.

Refs openclaw#107930
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant