Skip to content

feat(launcher): move the portable Node runtime to 24 LTS, upgrading existing installs - #747

Open
Ashin-LX-98 wants to merge 1 commit into
developfrom
feat/portable-node-24
Open

Ashin-LX-98 wants to merge 1 commit into
developfrom
feat/portable-node-24

Conversation

@Ashin-LX-98

Copy link
Copy Markdown
Collaborator

Summary

The portable Node runtime every npm agent installs into and runs on was pinned to v22.22.3, and existing installs never upgraded (the startup check was only "does node --version exit"). openclaw 2026.9.3+ requires Node >=24.16, so it was held back to 2026.9.2, and a self-installed newer openclaw could not start.

  • Pin: bootstrap/node-version.ts is the single source — Node v24.21.0 LTS; v22.22.3 on macOS < 13.5 (Darwin 22.6), which Node 24 does not support while Electron 42 still does. npm stays on 10.9.8 (engines cover Node 24; npm 11 is a separate decision).
  • Forced upgrade for existing users (bootstrap/node-upgrade.ts), run at launch when the installed runtime is older than the pin:
    1. download into nodejs.next and verify it runs; on failure keep the old runtime and retry next launch
    2. stop a daemon left over from the previous session (stopLeftoverDaemon, before the core is loaded) so Windows does not hold node.exe
    3. swap by rename (nodejs -> nodejs.old, nodejs.next -> nodejs), with retries for Windows locks and rollback if the second rename fails
    4. carry the core library, legacy shared-prefix agents, .bin shims and prefix package.json back from nodejs.old; it is deleted only when everything moved, and finishCarryOver retries on every launch
  • Unix node/npm/npx symlinks are now relative so a runtime built in a staging dir survives the rename.
  • core: installNodejs uses the same pin (Installer.portableNodeVersion()) and stops requesting a 32-bit Windows build.
  • Changelog 1.0.14 gets the user-facing note (1.0.14 is still untagged and ships with this).

Agents installed under ~/.openagents/runtimes/<type>/ are outside the replaced directory and untouched.

Test plan

  • Unit: version pinning / comparison, upgrade success, download failure, broken download, stale staging, locked old dir, failed second rename (rollback), partial carry-over then finishCarryOver
  • End-to-end on macOS in a sandboxed HOME with a copy of a real v22 prefix and a real download: v22.22.3 -> v24.21.0 in ~7s, leftover daemon stopped, core + prefix package.json + npm 10.9.8 kept, no .old/.next left, second launch is a no-op
  • Offline (connection refused): upgrade fails cleanly, v22 untouched, daemon not stopped
  • On Node 24: core 0.2.189 and 0.2.191 load; agn up/down with a claude agent, no errors or deprecation warnings in daemon.log
  • On Node 24: claude, codex, opencode, copilot, kimi, gemini, codebuddy, commandcode, openclaw all run; launcher-path installs of openclaw 2026.9.8 (preinstall passes), pi and deepseek succeed with npm 10.9.8 and run
  • Native modules on Node 24: @lydell/node-pty (gemini, codebuddy), clipboard, keytar load. gemini's bundled node-pty@1.0.0 (nan) fails to load as expected, but gemini prefers @lydell/node-pty
  • launcher vitest (893 passed), tsc -b, electron-vite build; core npm test (the 4 failures are pre-existing on develop)
  • Windows: upgrade from a v22 install with the daemon and agents running
  • Splash progress during the upgrade

🤖 Generated with Claude Code

…xisting installs

The portable runtime in ~/.openagents/nodejs was pinned to v22.22.3, and the
startup check only asked whether `node --version` exited, so existing machines
never left 22. openclaw 2026.9.3+ requires Node >=24.16 and was held back.

- Pin v24.21.0 in one place (bootstrap/node-version.ts). macOS before 13.5
  (Darwin 22.6), which Node 24 does not support, keeps v22.22.3. npm stays on
  10.9.8.
- Forced upgrade on launch (bootstrap/node-upgrade.ts): an older runtime is
  replaced by downloading into nodejs.next, verifying it runs, stopping a
  leftover daemon, swapping directories by rename, then carrying the core
  library, legacy shared-prefix agents and prefix package.json over from
  nodejs.old. Any failure before the swap keeps the old runtime; an
  unfinished carry-over is retried on every launch (finishCarryOver).
- Unix runtime symlinks (node/npm/npx) are now relative, so a runtime built
  in a staging dir still resolves after the rename.
- core: installNodejs uses the same pin via Installer.portableNodeVersion()
  and no longer requests a 32-bit Windows build that Node no longer ships.
- changelog 1.0.14: note the runtime upgrade.
@vercel

vercel Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openagents-workspace Ready Ready Preview Oct 5, 2026 10:36am UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview — 6df235a3 Deployed Oct 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant