Skip to content

fix(runtime): skip unsupported Node runtimes for helper processes - #197698

Merged
vincentkoc merged 3 commits into
mainfrom
fix/node-helper-supported-runtime-20261112
Nov 12, 2026
Merged

vincentkoc merged 3 commits into
mainfrom
fix/node-helper-supported-runtime-20261112

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes Node helper subprocesses selecting an unsupported system Node ahead of a supported installation when OpenClaw runs under Bun. In CI, Gateway post-ready maintenance launched Node 20.20.2 and failed to parse a compiled module's using declaration despite Node 24.22.1 being installed.

User Impact

Node-only helpers select a runtime supported by OpenClaw. If none is available, the resolver returns undefined through its existing contract. PATH hardening, candidate order, required flags, and caller environment handling stay unchanged.

Why This Change Was Made

The current-runtime fast path and standalone probe now use the existing canonical Node support predicate. The generated executable programs are regenerated through their owner. Existing resolver, generated-program, and child-process tests cover the behavior, and the SDK documentation describes the supported-runtime contract. Sparse CI and source-scanner fixtures retain the canonical version module required by the resolver.

Evidence

  • Real mixed-runtime reproduction in a qualified native checkout: the pinned Bun fork runs the existing Gateway post-ready settles case with official Node 20.20.2 ahead of supported Node in the test subprocess PATH. Before regeneration it fails on the same using syntax error; afterward the unchanged case passes. Results: 1 failed / 2 skipped before, 1 passed / 2 skipped after. Total wall times: 46.32s and 32.26s.
  • Focused proof: 7 resolver cases, 5 generated-program cases, and 2 real child-process cases pass. Resolver suite wall time 0.339s; generated-program test bodies total 0.366s within a 5.10s combined run; child-process suite wall time 2.07s.
  • Generated-output check, both affected test typecheck leaves, scoped type-aware lint, formatting, and diff checks pass.
  • Initial local review identified the stale generated programs; that correction is complete. Fresh full-range local review found no actionable correctness or security defects.
  • Ordinary CI on the first prepared head exposed two missing-module failures in sparse/isolated harnesses. The actual existing planner and scanner cases reproduced 2 failures / 1 pass before the two inventory additions and pass all 3 afterward (6.16s → 4.72s). Scoped typecheck, lint, formatting, workflow validation, and diff checks pass; a fresh correction review found no actionable correctness or security defects.
  • Corrected-head CI43208880460 completed with 83 successful jobs, 21 skipped and four workload failures plus the aggregate gate. Security, CodeQL, OpenGrep and workflow checks passed. The scanner regression also passed in hosted CI (455ms).
  • The remaining failures are retained under scoped maintainer source attribution: an upstream logger-worker fixture-graph mismatch, an upstream eager TLS import rejected by the existing help test, a fake Git missing the capability probe expected by the existing merge tests, and Docker prepublish packing of [email protected]. The Docker packing path and inputs are unchanged and do not invoke the changed resolver; its underlying npm error is unknown. No matching baseline execution or green CI is claimed. Final Boat qualification must still exercise the Docker payload.
  • The original CI failure is retained. The four separate Gateway RPC timeouts are outside this fix; this local reproduction does not claim a complete Linux or Windows qualification.

The mixed-runtime command is the normal test owner with an isolated fixture PATH:

PATH="$NODE20_BIN:$PATH" OPENCLAW_BUN_PATH="$PINNED_BUN" \
  OPENCLAW_VITEST_RUNTIME=bun OPENCLAW_VITEST_MAX_WORKERS=1 \
  "$SUPPORTED_NODE" scripts/run-vitest.mjs \
  --config test/vitest/vitest.gateway-server.config.ts \
  src/gateway/server-startup-post-ready.test.ts --maxWorkers=1 \
  -t 'holds post-ready maintenance until deferred startup settles'

@vincentkoc vincentkoc self-assigned this Nov 12, 2026
@clawsweeper

clawsweeper Bot commented Nov 12, 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 plugin: file-transfer size: S labels Nov 12, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 12, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 12, 2026
@clawsweeper

clawsweeper Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR makes Node helper selection apply OpenClaw’s existing supported-version policy.

Example: Bun hosts OpenClaw with Node 20.20.2 before Node 24.22.1 on PATH.

  • Before: The resolver selects Node 20.20.2, which cannot parse the helper’s compiled module.
  • After: The intended result is selection of Node 24.22.1; the committed generated probe still prevents that result.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) Useful and focused direction, but the shipped probe is unchanged and behavior validation is explicitly pending.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Partial
User problem: A Bun-hosted Gateway can select an older installed Node for a helper and fail while loading compiled JavaScript despite a supported Node being available.
Reason: This restores runtime compatibility at the shared selection owner, and the maintainer-authored PR already establishes direction; the generated production path remains incomplete.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this maintainer-authored draft open: the runtime-selection repair is useful, but the committed generated probe leaves the central failure unfixed.

Priority: P2
Reviewed head: 0da0d7decbed5e921b9b46682372a6991a50a396

Before merge

  • Regenerate the probe assets consumed by production (P2) - Changing this entrypoint does not change the program the resolver executes: createRuntimeProcessScriptFile("nodeRuntimeProbe") reads the embedded copy in runtime-process-scripts.generated.mjs, which still accepts any non-Bun Node. With Node 20.20.2 before Node 24.22.1 on PATH, this head therefore still selects Node 20.20.2, and the new generated-probe regression would still receive its executable path instead of an empty result. Run the native runtime-script generator and commit its affected outputs, including src/infra/node-runtime-probe.generated.mjs and runtime-process-scripts.generated.mjs.

Findings

  • [P2] Regenerate the probe assets consumed by production — src/infra/node-runtime-probe.entry.ts:7

Tests

  • Low-value test src/infra/node-runtime-executable.test.ts: Remove the added unsupported-runtime mock variant: it supplies empty probe output itself and repeats rejection handling already exercised by the Bun-shim case without testing version admission.
  • Missing end-to-end proof: Provide red-on-base/green-on-fix regression results and redacted fresh-install and latest-stable-upgrade Gateway output showing Node 20.20.2 skipped for Node 24.22.1, plus the no-supported-Node result.
Agent review details

How this fits together

The shared resolver receives executable-search environment and an optional required flag, probes installed Node candidates, and returns an executable path or undefined to core and Plugin SDK callers.

flowchart TD
  A[Core and plugin callers] --> B[Node runtime resolver]
  B --> C[Current runtime check]
  B --> D[Generated probe materializer]
  D --> E[PATH candidate processes]
  C --> F[Executable or undefined]
  E --> F
Loading

Technical review

Best possible solution:

Apply the canonical predicate through the existing resolver and regenerate its shipped probe assets without adding another selection path.

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

Source shows that Bun-hosted resolution accepts Node 20.20.2 before a supported PATH candidate because the generated probe lacks version admission; no target code was executed.

Is this the best way to solve the issue?

Reusing the canonical version predicate is the smallest complete repair, provided its generated production copies are updated too.

Full review comments:

  • [P2] Regenerate the probe assets consumed by production — src/infra/node-runtime-probe.entry.ts:7
    Changing this entrypoint does not change the program the resolver executes: createRuntimeProcessScriptFile("nodeRuntimeProbe") reads the embedded copy in runtime-process-scripts.generated.mjs, which still accepts any non-Bun Node. With Node 20.20.2 before Node 24.22.1 on PATH, this head therefore still selects Node 20.20.2, and the new generated-probe regression would still receive its executable path instead of an empty result. Run the native runtime-script generator and commit its affected outputs, including src/infra/node-runtime-probe.generated.mjs and runtime-process-scripts.generated.mjs.
    Confidence: 1

Overall correctness: patch is incorrect
Overall confidence: 0.99

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Shared Node executable selection keeps the original intent (21db4e9: Locate real Node sidecars under Bun while preserving required-flag checks and sterile probing.)
  • Retained standalone probe assets keeps the original intent (fe0be1a: Keep helper programs self-contained and available in packaged and standalone builds.)
  • Portable Node test fixtures and caller environment keeps the original intent (2f5822a: Ensure Node-specific fixtures launch actual Node under Bun; later environment forwarding preserves child-specific executable search.)
  • SDK resolver documentation changes intended behavior with a stated reason (65485f6: Document the shared real-Node selection contract; this PR explains its intentional restriction to OpenClaw-supported versions.)

Testing

Proof path: none.

Security

None.

Evidence

What I checked:

PR surface

Source +5, Tests +37, Docs +1. Total +43 across 6 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 7 2 +5
Tests 3 44 7 +37
Docs 1 4 3 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 55 12 +43

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: Mixed Node installations under Bun can launch incompatible helpers; the repair has a narrow shared owner.
  • add merge-risk: 🚨 compatibility: The public process-runtime resolver intentionally stops returning unsupported Node executables; the maintainer-authored body accepts undefined when only unsupported installations exist.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: Mixed Node installations under Bun can launch incompatible helpers; the repair has a narrow shared owner.
  • merge-risk: 🚨 compatibility: The public process-runtime resolver intentionally stops returning unsupported Node executables; the maintainer-authored body accepts undefined when only unsupported installations exist.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 12, 2026, 6:05 AM ET / 11:05 UTC.

@vincentkoc
vincentkoc marked this pull request as ready for review November 12, 2026 11:10
@vincentkoc
vincentkoc merged commit f8de201 into main Nov 12, 2026
170 of 176 checks passed
@vincentkoc
vincentkoc deleted the fix/node-helper-supported-runtime-20261112 branch November 12, 2026 11:47
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 13, 2026
…enclaw#197698)

* fix: skip unsupported Node runtimes for helper processes

* fix(runtime): regenerate supported Node probe

* fix(ci): retain Node version contract in sparse harnesses
github-actions Bot pushed a commit to clawhaven/openclaw that referenced this pull request Nov 23, 2026
Source: f8de201 (openclaw#197698)

Release adaptation: enforce the floor in the baseline shared sync/async preparation owner; preserve its async resolver. Regenerate runtime assets canonically. Exclude unrelated CI allocation changes.

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 63f19c40e7283d54dfc12bec37aeb50508a117a8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. plugin: file-transfer rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S 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