fix: prevent devai:install composer hang on invisible prompt#140
Merged
Conversation
The devai:install docs-driver step shelled out to `composer require --dev` through CommandRunner, which opened only stdout/stderr pipes and left the child inheriting the parent's TTY stdin. Composer therefore saw an interactive terminal and could block on a prompt (e.g. the allow-plugins trust question) whose text was buffered and never echoed — an invisible, infinite hang. Detach the child's stdin to /dev/null in CommandRunner so no shelled-out command can ever block on terminal input, and pass --no-interaction --no-progress to the composer require call so composer is contractually forbidden from prompting. Add a CommandRunner test proving a stdin-reading child returns immediately instead of deadlocking. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Problem
marko devai:installcould hang indefinitely at:The docs-driver step shells out to
composer require --devviaCommandRunner, which opened only stdout/stderr pipes and left the child inheriting the parent's TTY stdin. Composer thus detected an interactive terminal and could block on a prompt (most commonly theallow-pluginstrust question). BecauseCommandRunnerbuffers all child output and never echoes it, that prompt was invisible — composer sat waiting for a keystroke the user couldn't see, an infinite hang.It reproduced reliably with a cold cache + missing driver:
composer remove marko/docs-fts --no-interaction rm -rf vendor/marko/docs-fts composer clearcache marko devai:install # answer y → hangsFix
CommandRunner— detach the child's stdin to/dev/null(0 => ['file', '/dev/null', 'r']) so no shelled-out command can ever block on terminal input. Structural guard for every caller.InstallCommand— pass--no-interaction --no-progressto the composer require call so composer is contractually forbidden from prompting.Tests
CommandRunnerTestcase: a child runningread line; echo donenow returns in <10s instead of deadlocking — the deterministic guarantee that stdin can't block.InstallCommandTestassertion to expect the new composer args.Full
packages/devaisuite green (253 passed); lint clean on all touched files.Out of scope
The buffered-silence UX (no live progress during a slow resolve) is unchanged — this PR stops the hang, not the quiet. A follow-up could stream runner output live.
🤖 Generated with Claude Code