From 4570e1db7d573e29149378451e5ba26cf8bd0259 Mon Sep 17 00:00:00 2001 From: danielz1z Date: Sun, 11 Jan 2026 07:33:03 +0000 Subject: [PATCH] fix(update): merge custom env with process.env in spawn MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the update runner passes custom env vars (like CLAWDBOT_UPDATE_IN_PROGRESS), the current code uses `env ?? process.env` which replaces the entire environment instead of merging — losing PATH, HOME, etc. This causes the doctor step to fail with 'node: No such file or directory'. Fix: merge custom env with process.env instead of replacing it. --- src/process/exec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/process/exec.ts b/src/process/exec.ts index 19a19ac2b..4a0d6f831 100644 --- a/src/process/exec.ts +++ b/src/process/exec.ts @@ -66,7 +66,7 @@ export async function runCommandWithTimeout( const child = spawn(argv[0], argv.slice(1), { stdio: [hasInput ? "pipe" : "inherit", "pipe", "pipe"], cwd, - env: env ?? process.env, + env: env ? { ...process.env, ...env } : process.env, }); let stdout = ""; let stderr = "";