Skip to content

Commit 32bd288

Browse files
committed
1 parent 3b8f9fb commit 32bd288

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎node-version.d.mts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ export function isNodeVersionAtLeast(
1010
minimum: NodeReleaseVersion,
1111
): boolean;
1212
export function isSupportedOpenClawNodeVersion(value: unknown): boolean;
13-
export const OPENCLAW_PROCESS_NODE_VERSION_CHECK: string;
13+
export const PROCESS_NODE_VERSION_CHECK: string;

‎node-version.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,4 @@ function renderProcessNodeVersionCheck() {
7373

7474
// Worker bootstrap runs before OpenClaw is transferred. Carry the canonical
7575
// release policy as a self-contained expression instead of a second parser.
76-
export const OPENCLAW_PROCESS_NODE_VERSION_CHECK = renderProcessNodeVersionCheck();
76+
export const PROCESS_NODE_VERSION_CHECK = renderProcessNodeVersionCheck();

‎src/gateway/worker-environments/bootstrap.test.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { runInNewContext } from "node:vm";
55
import { describe, expect, it } from "vitest";
66
import {
77
isSupportedOpenClawNodeVersion,
8-
OPENCLAW_PROCESS_NODE_VERSION_CHECK,
8+
PROCESS_NODE_VERSION_CHECK,
99
} from "../../../node-version.mjs";
1010
import { NODE_RELEASE_VERSION_CASES } from "../../../test/helpers/node-version-cases.js";
1111
import type { WorkerSshEndpoint } from "../../plugins/types.js";
@@ -392,15 +392,15 @@ describe("bootstrapWorker", () => {
392392
).rejects.toThrow("Node 22.22.3+, 24.15.0+, or 25.9.0+ with WAL-reset-safe SQLite");
393393
expect(runner.calls).toHaveLength(2);
394394
expect(runner.calls[0]?.options.input).toContain(
395-
`const nodeSafe = ${OPENCLAW_PROCESS_NODE_VERSION_CHECK};`,
395+
`const nodeSafe = ${PROCESS_NODE_VERSION_CHECK};`,
396396
);
397397
expect(runner.calls[0]?.options.input).toContain("SELECT sqlite_version() AS version");
398398
});
399399

400400
it("embeds a shell-safe Node release check matching the canonical contract", () => {
401-
expect(OPENCLAW_PROCESS_NODE_VERSION_CHECK).not.toContain("'");
401+
expect(PROCESS_NODE_VERSION_CHECK).not.toContain("'");
402402
for (const version of NODE_RELEASE_VERSION_CASES) {
403-
const actual = runInNewContext(OPENCLAW_PROCESS_NODE_VERSION_CHECK, {
403+
const actual = runInNewContext(PROCESS_NODE_VERSION_CHECK, {
404404
process: { versions: { node: version } },
405405
});
406406
expect(actual, version).toBe(isSupportedOpenClawNodeVersion(version));

‎src/gateway/worker-environments/bootstrap.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createHash } from "node:crypto";
22
import { truncateUtf16Safe } from "@openclaw/normalization-core/utf16-slice";
3-
import { OPENCLAW_PROCESS_NODE_VERSION_CHECK } from "../../../node-version.mjs";
3+
import { PROCESS_NODE_VERSION_CHECK } from "../../../node-version.mjs";
44
import {
55
type WorkerAdmissionHandshake,
66
WORKER_PROTOCOL_MAX_FEATURE_LENGTH,
@@ -78,7 +78,7 @@ export function workerBootstrapOperationTimeoutMs(artifact: WorkerInstallationAr
7878
}
7979

8080
const NODE_RUNTIME_CHECK_JS = String.raw`const parse = (value) => /^(\d+)\.(\d+)\.(\d+)$/.exec(value)?.slice(1).map(Number); const atLeast = (version, floor) => version[0] > floor[0] || (version[0] === floor[0] && (version[1] > floor[1] || (version[1] === floor[1] && version[2] >= floor[2])));
81-
const nodeSafe = ${OPENCLAW_PROCESS_NODE_VERSION_CHECK};
81+
const nodeSafe = ${PROCESS_NODE_VERSION_CHECK};
8282
if (!nodeSafe) process.exit(1);
8383
try { const { DatabaseSync } = require("node:sqlite"); const db = new DatabaseSync(":memory:");
8484
const sqlite = parse(String(db.prepare("SELECT sqlite_version() AS version").get()?.version ?? ""));

0 commit comments

Comments
 (0)