From 2d227ed02c39b694a207f3fa3f2ef7b090fb825c Mon Sep 17 00:00:00 2001 From: David Maynor Date: Wed, 4 Feb 2026 22:56:52 -0500 Subject: [PATCH] Fix Windows wizard failure by sending prompt via stdin for stream-json mode When using stream-json output mode on Windows, the prompt was being added both as a CLI argument AND sent via stdin, causing the command line to exceed cmd.exe's ~8191 character limit and resulting in immediate exit code 1. Now detects when stream-json is in the args and ensures the prompt is sent only via stdin, avoiding the command line length limit. Fixes #301 Co-Authored-By: Claude Opus 4.5 --- src/main/process-manager/spawners/ChildProcessSpawner.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/process-manager/spawners/ChildProcessSpawner.ts b/src/main/process-manager/spawners/ChildProcessSpawner.ts index 6a721d21..a6ec3a81 100644 --- a/src/main/process-manager/spawners/ChildProcessSpawner.ts +++ b/src/main/process-manager/spawners/ChildProcessSpawner.ts @@ -73,7 +73,11 @@ export class ChildProcessSpawner { // Check if prompt will be sent via stdin instead of command line // This is critical for SSH remote execution to avoid shell escaping issues - const promptViaStdin = sendPromptViaStdin || sendPromptViaStdinRaw; + // Also critical on Windows: when using stream-json output mode, the prompt is sent + // via stdin (see stream-json stdin write below). Adding it as a CLI arg too would + // exceed cmd.exe's ~8191 character command line limit, causing immediate exit code 1. + const argsHaveStreamJson = args.some((arg) => arg.includes('stream-json')); + const promptViaStdin = sendPromptViaStdin || sendPromptViaStdinRaw || argsHaveStreamJson; // Build final args based on batch mode and images let finalArgs: string[];