Repository navigation
chore(cli): fix examples that pipe stdin alongside a droid exec prompt - #62
Closed
lukealvoeiro wants to merge 1 commit into
Closed
lukealvoeiro wants to merge 1 commit into
lukealvoeiro wants to merge 1 commit into
Conversation
Contributor
|
Droid finished @lukealvoeiro's task —— View job The documentation examples now match the CLI's stdin behavior. No actionable issues were identified. 0 inline comments posted |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Gap
droid execignores piped stdin when a prompt argument is also given, but two docs examples (EN and JP) pipe content and pass a prompt at the same time. Users who copy them get a run that never sees the piped content, and nothing tells them.Evidence
Docs:
docs/reference/cli-reference.mdx:101(JPdocs/jp/reference/cli-reference.mdx:33): examplegit diff | droid exec "draft release notes".docs/guides/droid-exec/github-actions.mdx:50-51(JP same file, same lines):# Review and fix issues (pipe diff to stdin)followed bycat pr_changes.diff | droid exec --auto low "Review this PR diff and: ...".Code (
Factory-AI/factory-mono,apps/cli/src/entrypoints/exec/handler.ts,resolvePromptArg): the documented priority is--file> piped stdin > prompt argument, but stdin is only read when there is no prompt argument:Command run against a source build of the CLI on current
dev, with the repo's mock LLM server:Exit code 0. The only user message sent to the model was
"text":"arg prompt"; the content ofp.txtwas never sent.Why it matters
The GitHub Actions guide is a copy-paste CI workflow. With the current example, Droid reviews and edits code without ever seeing the PR diff, and the step still succeeds.
Fix
cat review-prompt.md | droid exec).pr_changes.difffile the step already writes instead of piping it, and explain why in the comment.Changing the CLI to merge stdin with a prompt argument would need to read stdin in cases it does not read today, which can block callers that leave a stdin pipe open (for example Node
spawnwith default stdio). That is a product decision, so this PR fixes the docs to match current behavior.Validation
dev(a227be78f53).| droid execexample indocs/(EN and JP); none of them also passes a prompt argument.Found by the scheduled CLI arguments audit.