Skip to content

Commit 939b288

Browse files
fix(server): SSH device test rejects Node below agent-device's 22.12 floor (#35991)
1 parent 43ce395 commit 939b288

3 files changed

Lines changed: 18 additions & 2 deletions

File tree

‎apps/server/src/device/sshDeviceScript.test.ts‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,21 @@ it.effect("preserves shell metacharacters and newlines in remote arguments", ()
4646
}),
4747
);
4848

49+
it.effect("rejects a Node release below the pinned agent-device engine floor", () =>
50+
Effect.gen(function* () {
51+
if ((yield* HostProcess.Platform) === "win32") return;
52+
const probe = NodeChildProcess.spawnSync(process.execPath, [], {
53+
input:
54+
`Object.defineProperty(process.versions, "node", { value: "22.11.0" });\n` +
55+
remoteDeviceScript("owner", "probe"),
56+
env: { HOME: NodeOS.tmpdir(), PATH: NodePath.dirname(process.execPath) },
57+
encoding: "utf8",
58+
});
59+
expect(probe.status).not.toBe(0);
60+
expect(probe.stderr).toContain("Node 22.12 or newer");
61+
}),
62+
);
63+
4964
it.effect("stops a daemon left for its owner when starting without agent tools", () =>
5065
Effect.gen(function* () {
5166
if ((yield* HostProcess.Platform) === "win32") return;

‎apps/server/src/device/sshDeviceScript.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ async function install(name, version, entry) {
139139
{ platform: 'android', available: android, ...(!android ? { reason: 'Android SDK missing. Set ANDROID_HOME or put adb on the SSH PATH.' } : {}) },
140140
];
141141
if (mode === 'probe') {
142-
if (Number(process.versions.node.split('.')[0]) < 22) throw Error('Node 22 or newer is required on the device host.');
142+
const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(Number);
143+
if (nodeMajor < 22 || (nodeMajor === 22 && nodeMinor < 12)) throw Error('Node 22.12 or newer is required on the device host.');
143144
if (run('npm', ['--version']).status !== 0) throw Error('npm is missing from the non-interactive SSH PATH.');
144145
console.log(JSON.stringify({ nodePath: process.execPath, platforms, tools: versions() })); return;
145146
}

‎docs/user/devices.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ the environment’s own machine are skipped, since its devices are already local
110110
The first device listing installs pinned device tools on the host.
111111
SSH device hosts currently need macOS or Linux. To use devices on a Windows
112112
machine, run T3 Code on that machine and connect to its environment.
113-
Node 22 or newer and npm must be available to non-interactive SSH commands.
113+
Node 22.12 or newer and npm must be available to non-interactive SSH commands.
114114
T3 checks common Homebrew and Android SDK locations; custom installations need
115115
the appropriate PATH and ANDROID_HOME on the host. Android emulator video needs
116116
`ffmpeg` with libx264 on that host; physical Android devices use scrcpy and do

0 commit comments

Comments
 (0)