fix(runner): read child output by chunk to prevent hanging on interactive prompts#13
Conversation
…tive prompts Previously, the command executor read child process stdout/stderr line-by-line using `BufReader::lines().next_line()`. This blocked output buffering if the process prompted for user input without emitting a newline (e.g., `[Y/n] ` or `[sudo] password:`). The user would see a hung process. This changes the reading logic to use chunked byte-reading `tokio::io::AsyncReadExt::read()`, which streams partial lines immediately to the user's terminal, greatly improving reliability and UX for interactive commands. Co-authored-by: insign <1113045+insign@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e6923ec208
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| match res { | ||
| Ok(0) => stdout_done = true, | ||
| Ok(n) => { | ||
| print!("{}", String::from_utf8_lossy(&stdout_buf[..n])); |
There was a problem hiding this comment.
Preserve UTF-8 boundaries when streaming chunked output
Decoding each read() chunk independently with String::from_utf8_lossy can corrupt valid UTF-8 output whenever a multibyte character is split across chunk boundaries. In that case, this path emits replacement characters (�) and loses the original text, so commands that print non-ASCII output (localized package managers, Unicode filenames, etc.) can display garbled prompts/logs. The same pattern is used for both stdout and stderr, so both streams are affected.
Useful? React with 👍 / 👎.
|
Este PR ainda não pode ser mesclado porque o job |
Updated |
Previously, the command executor read child process stdout/stderr line-by-line using `BufReader::lines().next_line()`. This blocked output buffering if the process prompted for user input without emitting a newline (e.g., `[Y/n] ` or `[sudo] password:`). The user would see a hung process. This changes the reading logic to use chunked byte-reading `tokio::io::AsyncReadExt::read()`, which streams partial lines immediately to the user's terminal, greatly improving reliability and UX for interactive commands. This commit also updates `rustls-webpki` to version `0.103.13` to resolve security vulnerabilities (RUSTSEC-2026-0104, RUSTSEC-2026-0098, RUSTSEC-2026-0099). Co-authored-by: insign <1113045+insign@users.noreply.github.com>
This PR changes the
CommandExecutorstreaming logic to readstdoutandstderrby byte chunks rather than line-by-line. This fixes a major UX bug where commands that pause for user input without a trailing newline (likesudopassword prompts orapt-getconfirmations) would appear completely hung because the output stream was waiting for a newline to yield the prompt to the user. This guarantees real-time output synchronization.PR created automatically by Jules for task 312348395045082456 started by @insign