Skip to content

Commit deada7e

Browse files
altaywtfobviyus
authored andcommitted
build: default to Node 24 and keep Node 22 compat
1 parent 2f037f0 commit deada7e

File tree

30 files changed

+103
-70
lines changed

30 files changed

+103
-70
lines changed

.github/actions/setup-node-env/action.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
name: Setup Node environment
22
description: >
3-
Initialize submodules with retry, install Node 22, pnpm, optionally Bun,
3+
Initialize submodules with retry, install Node 24 by default, pnpm, optionally Bun,
44
and optionally run pnpm install. Requires actions/checkout to run first.
55
inputs:
66
node-version:
77
description: Node.js version to install.
88
required: false
9-
default: "22.x"
9+
default: "24.x"
10+
cache-key-suffix:
11+
description: Suffix appended to the pnpm store cache key.
12+
required: false
13+
default: "node24"
1014
pnpm-version:
1115
description: pnpm version for corepack.
1216
required: false
@@ -54,7 +58,7 @@ runs:
5458
uses: ./.github/actions/setup-pnpm-store-cache
5559
with:
5660
pnpm-version: ${{ inputs.pnpm-version }}
57-
cache-key-suffix: "node22"
61+
cache-key-suffix: ${{ inputs.cache-key-suffix }}
5862
use-sticky-disk: ${{ inputs.use-sticky-disk }}
5963

6064
- name: Setup Bun

.github/actions/setup-pnpm-store-cache/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ inputs:
88
cache-key-suffix:
99
description: Suffix appended to the cache key.
1010
required: false
11-
default: "node22"
11+
default: "node24"
1212
use-sticky-disk:
1313
description: Use Blacksmith sticky disks instead of actions/cache for pnpm store.
1414
required: false

.github/workflows/ci.yml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,34 @@ jobs:
233233
- name: Check docs
234234
run: pnpm check:docs
235235

236+
compat-node22:
237+
name: "compat-node22"
238+
needs: [docs-scope, changed-scope]
239+
if: needs.docs-scope.outputs.docs_only != 'true' && (github.event_name == 'push' || needs.changed-scope.outputs.run_node == 'true')
240+
runs-on: blacksmith-16vcpu-ubuntu-2404
241+
steps:
242+
- name: Checkout
243+
uses: actions/checkout@v4
244+
with:
245+
submodules: false
246+
247+
- name: Setup Node 22 compatibility environment
248+
uses: ./.github/actions/setup-node-env
249+
with:
250+
node-version: "22.x"
251+
cache-key-suffix: "node22"
252+
install-bun: "false"
253+
use-sticky-disk: "true"
254+
255+
- name: Configure Node 22 test resources
256+
run: |
257+
# Keep the compatibility lane aligned with the default Node test lane.
258+
echo "OPENCLAW_TEST_WORKERS=2" >> "$GITHUB_ENV"
259+
echo "OPENCLAW_TEST_MAX_OLD_SPACE_SIZE_MB=6144" >> "$GITHUB_ENV"
260+
261+
- name: Run Node 22 compatibility gate
262+
run: pnpm build && pnpm test
263+
236264
skills-python:
237265
needs: [docs-scope, changed-scope]
238266
if: needs.docs-scope.outputs.docs_only != 'true' && (github.event_name == 'push' || needs.changed-scope.outputs.run_node == 'true' || needs.changed-scope.outputs.run_skills_python == 'true')
@@ -401,14 +429,14 @@ jobs:
401429
- name: Setup Node.js
402430
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
403431
with:
404-
node-version: 22.x
432+
node-version: 24.x
405433
check-latest: false
406434

407435
- name: Setup pnpm + cache store
408436
uses: ./.github/actions/setup-pnpm-store-cache
409437
with:
410438
pnpm-version: "10.23.0"
411-
cache-key-suffix: "node22"
439+
cache-key-suffix: "node24"
412440
# Sticky disk mount currently retries/fails on every shard and adds ~50s
413441
# before install while still yielding zero pnpm store reuse.
414442
# Try exact-key actions/cache restores instead to recover store reuse

.github/workflows/openclaw-npm-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ concurrency:
1010
cancel-in-progress: false
1111

1212
env:
13-
NODE_VERSION: "22.x"
13+
NODE_VERSION: "24.x"
1414
PNPM_VERSION: "10.23.0"
1515

1616
jobs:

Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
# Slim (bookworm-slim): docker build --build-arg OPENCLAW_VARIANT=slim .
1515
ARG OPENCLAW_EXTENSIONS=""
1616
ARG OPENCLAW_VARIANT=default
17-
ARG OPENCLAW_NODE_BOOKWORM_IMAGE="node:22-bookworm@sha256:b501c082306a4f528bc4038cbf2fbb58095d583d0419a259b2114b5ac53d12e9"
18-
ARG OPENCLAW_NODE_BOOKWORM_DIGEST="sha256:b501c082306a4f528bc4038cbf2fbb58095d583d0419a259b2114b5ac53d12e9"
19-
ARG OPENCLAW_NODE_BOOKWORM_SLIM_IMAGE="node:22-bookworm-slim@sha256:9c2c405e3ff9b9afb2873232d24bb06367d649aa3e6259cbe314da59578e81e9"
20-
ARG OPENCLAW_NODE_BOOKWORM_SLIM_DIGEST="sha256:9c2c405e3ff9b9afb2873232d24bb06367d649aa3e6259cbe314da59578e81e9"
17+
ARG OPENCLAW_NODE_BOOKWORM_IMAGE="node:24-bookworm@sha256:3a09aa6354567619221ef6c45a5051b671f953f0a1924d1f819ffb236e520e6b"
18+
ARG OPENCLAW_NODE_BOOKWORM_DIGEST="sha256:3a09aa6354567619221ef6c45a5051b671f953f0a1924d1f819ffb236e520e6b"
19+
ARG OPENCLAW_NODE_BOOKWORM_SLIM_IMAGE="node:24-bookworm-slim@sha256:e8e2e91b1378f83c5b2dd15f0247f34110e2fe895f6ca7719dbb780f929368eb"
20+
ARG OPENCLAW_NODE_BOOKWORM_SLIM_DIGEST="sha256:e8e2e91b1378f83c5b2dd15f0247f34110e2fe895f6ca7719dbb780f929368eb"
2121

2222
# Base images are pinned to SHA256 digests for reproducible builds.
2323
# Trade-off: digests must be updated manually when upstream tags move.
24-
# To update, run: docker manifest inspect node:22-bookworm (or podman)
24+
# To update, run: docker buildx imagetools inspect node:24-bookworm (or podman)
2525
# and replace the digest below with the current multi-arch manifest list entry.
2626

2727
FROM ${OPENCLAW_NODE_BOOKWORM_IMAGE} AS ext-deps
@@ -92,12 +92,12 @@ RUN CI=true pnpm prune --prod && \
9292
# ── Runtime base images ─────────────────────────────────────────
9393
FROM ${OPENCLAW_NODE_BOOKWORM_IMAGE} AS base-default
9494
ARG OPENCLAW_NODE_BOOKWORM_DIGEST
95-
LABEL org.opencontainers.image.base.name="docker.io/library/node:22-bookworm" \
95+
LABEL org.opencontainers.image.base.name="docker.io/library/node:24-bookworm" \
9696
org.opencontainers.image.base.digest="${OPENCLAW_NODE_BOOKWORM_DIGEST}"
9797

9898
FROM ${OPENCLAW_NODE_BOOKWORM_SLIM_IMAGE} AS base-slim
9999
ARG OPENCLAW_NODE_BOOKWORM_SLIM_DIGEST
100-
LABEL org.opencontainers.image.base.name="docker.io/library/node:22-bookworm-slim" \
100+
LABEL org.opencontainers.image.base.name="docker.io/library/node:24-bookworm-slim" \
101101
org.opencontainers.image.base.digest="${OPENCLAW_NODE_BOOKWORM_SLIM_DIGEST}"
102102

103103
# ── Stage 3: Runtime ────────────────────────────────────────────
@@ -209,7 +209,7 @@ RUN ln -sf /app/openclaw.mjs /usr/local/bin/openclaw \
209209
ENV NODE_ENV=production
210210

211211
# Security hardening: Run as non-root user
212-
# The node:22-bookworm image includes a 'node' user (uid 1000)
212+
# The node:24-bookworm image includes a 'node' user (uid 1000)
213213
# This reduces the attack surface by preventing container escape via root privileges
214214
USER node
215215

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ OpenClaw is a **self-hosted gateway** that connects your favorite chat apps —
5454
- **Agent-native**: built for coding agents with tool use, sessions, memory, and multi-agent routing
5555
- **Open source**: MIT licensed, community-driven
5656

57-
**What do you need?** Node 22+, an API key from your chosen provider, and 5 minutes. For best quality and security, use the strongest latest-generation model available.
57+
**What do you need?** Node 24 (recommended), or Node 22.12+ for compatibility, an API key from your chosen provider, and 5 minutes. For best quality and security, use the strongest latest-generation model available.
5858

5959
## How it works
6060

docs/install/ansible.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ The Ansible playbook installs and configures:
4646
1. **Tailscale** (mesh VPN for secure remote access)
4747
2. **UFW firewall** (SSH + Tailscale ports only)
4848
3. **Docker CE + Compose V2** (for agent sandboxes)
49-
4. **Node.js 22.x + pnpm** (runtime dependencies)
49+
4. **Node.js 24 + pnpm** (runtime dependencies; Node `22.12+` remains supported for compatibility)
5050
5. **OpenClaw** (host-based, not containerized)
5151
6. **Systemd service** (auto-start with security hardening)
5252

docs/install/bun.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ bun run vitest run
4545
Bun may block dependency lifecycle scripts unless explicitly trusted (`bun pm untrusted` / `bun pm trust`).
4646
For this repo, the commonly blocked scripts are not required:
4747

48-
- `@whiskeysockets/baileys` `preinstall`: checks Node major >= 20 (we run Node 22+).
48+
- `@whiskeysockets/baileys` `preinstall`: checks Node major >= 20 (OpenClaw defaults to Node 24 and still supports Node `22.12+`).
4949
- `protobufjs` `postinstall`: emits warnings about incompatible version schemes (no build artifacts).
5050

5151
If you hit a real runtime issue that requires these scripts, trust them explicitly:

docs/install/docker.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,13 @@ Common tags:
165165

166166
The main Docker image currently uses:
167167

168-
- `node:22-bookworm`
168+
- `node:24-bookworm`
169169

170170
The docker image now publishes OCI base-image annotations (sha256 is an example,
171171
and points at the pinned multi-arch manifest list for that tag):
172172

173-
- `org.opencontainers.image.base.name=docker.io/library/node:22-bookworm`
174-
- `org.opencontainers.image.base.digest=sha256:b501c082306a4f528bc4038cbf2fbb58095d583d0419a259b2114b5ac53d12e9`
173+
- `org.opencontainers.image.base.name=docker.io/library/node:24-bookworm`
174+
- `org.opencontainers.image.base.digest=sha256:3a09aa6354567619221ef6c45a5051b671f953f0a1924d1f819ffb236e520e6b`
175175
- `org.opencontainers.image.source=https://github.com/openclaw/openclaw`
176176
- `org.opencontainers.image.url=https://openclaw.ai`
177177
- `org.opencontainers.image.documentation=https://docs.openclaw.ai/install/docker`
@@ -408,7 +408,7 @@ To speed up rebuilds, order your Dockerfile so dependency layers are cached.
408408
This avoids re-running `pnpm install` unless lockfiles change:
409409

410410
```dockerfile
411-
FROM node:22-bookworm
411+
FROM node:24-bookworm
412412

413413
# Install Bun (required for build scripts)
414414
RUN curl -fsSL https://bun.sh/install | bash

docs/install/gcp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ If you add new skills later that depend on additional binaries, you must:
306306
**Example Dockerfile**
307307

308308
```dockerfile
309-
FROM node:22-bookworm
309+
FROM node:24-bookworm
310310
311311
RUN apt-get update && apt-get install -y socat && rm -rf /var/lib/apt/lists/*
312312

0 commit comments

Comments
 (0)