From bc64f2613be153e64aebdbf4686c368ddb879d60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=A9=98?= Date: Sat, 23 May 2026 08:58:05 +0000 Subject: [PATCH] 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 --- packages/cli-workflow/src/commands/thread.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/cli-workflow/src/commands/thread.ts b/packages/cli-workflow/src/commands/thread.ts index c3f66b7..46c4589 100644 --- a/packages/cli-workflow/src/commands/thread.ts +++ b/packages/cli-workflow/src/commands/thread.ts @@ -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