-
Notifications
You must be signed in to change notification settings - Fork 259
Fix Windows wizard failure by sending prompt via stdin for stream-json mode #302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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; | ||
|
Comment on lines
+79
to
+80
|
||
|
|
||
| // Build final args based on batch mode and images | ||
| let finalArgs: string[]; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The detection logic using
.includes('stream-json')could potentially match unintended patterns. For example, if a hypothetical flag like--no-stream-jsonor--stream-json-disabledwere used, it would incorrectly trigger stdin mode. Consider using a more precise check that matches the specific expected patterns likearg === 'stream-json'after splitting on equals signs, or check for--output-formatfollowed bystream-json, or--input-formatfollowed bystream-json.