fix(thread): handle null stderr from execFileSync, increase maxBuffer to 50MB

- err.stderr can be null (not just undefined) when child process fails
- maxBuffer default (1MB) too small for stream-json verbose output
This commit is contained in:
2026-05-23 08:58:05 +00:00
parent 0e5b494e12
commit bc64f2613b
+3 -2
View File
@@ -661,11 +661,12 @@ function spawnAgent(
encoding: "utf8",
env,
stdio: ["ignore", "pipe", "pipe"],
maxBuffer: 50 * 1024 * 1024, // 50 MB — stream-json output can be large
});
} catch (e) {
const err = e as NodeJS.ErrnoException & { stderr?: Buffer | string };
const err = e as NodeJS.ErrnoException & { stderr?: Buffer | string | null };
const stderr =
err.stderr === undefined
err.stderr == null
? ""
: typeof err.stderr === "string"
? err.stderr