Skip to content

fix: pass prompt as CLI arg instead of stdin - #5

Open
dep wants to merge 1 commit into
unblocked:mainfrom
dep:fix/print-stdin-arg-parsing
Open

fix: pass prompt as CLI arg instead of stdin#5
dep wants to merge 1 commit into
unblocked:mainfrom
dep:fix/print-stdin-arg-parsing

Conversation

@dep

@dep dep commented Jul 7, 2026

Copy link
Copy Markdown

Summary

  • The baseline arm intermittently failed with "Input must be provided either through stdin or as a prompt argument when using --print" — writing the prompt via stdin raced against the CLI's stdin-availability check.
  • Switched to passing the prompt as a positional CLI argument, which exposed a second bug: the variadic --disallowed-tools <tools...> flag greedily consumed the entire trailing prompt as additional tool names since nothing terminated the option list.
  • Fixed by passing all disallowed tools in a single call and adding -- before the prompt to terminate option parsing.

Test plan

  • bunx tsc --noEmit -p . passes
  • Ran bun start -- --repo <repo> --task "..." — both baseline and unblocked arms completed successfully (exit=0) with no parsing errors

The baseline arm intermittently failed with "Input must be provided
either through stdin or as a prompt argument when using --print".
Passing the prompt via stdin raced against the CLI's stdin-availability
check. Switching to a positional prompt arg avoids the race, but exposed
a second bug: the variadic --disallowed-tools flag greedily consumed
the entire prompt as additional tool names since nothing terminated the
option list. Fixed by passing all disallowed tools in one call and
adding -- before the prompt.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant