Skip to content

feat: improve stdio handling with async writers#160

Merged
branchseer merged 3 commits intomainfrom
feat_improve_stdio_handling_with_async_writers
Feb 15, 2026
Merged

feat: improve stdio handling with async writers#160
branchseer merged 3 commits intomainfrom
feat_improve_stdio_handling_with_async_writers

Conversation

@branchseer
Copy link
Copy Markdown
Member

@branchseer branchseer commented Feb 15, 2026

Summary

Extends the existing "stdin suggestion" system to a full "stdio" system. Previously, only stdin was conditionally inherited vs null. Now, all three stdio FDs (stdin, stdout, stderr) are conditionally inherited vs piped, and the reporter provides Box<dyn AsyncWrite + Unpin> streams for receiving child process output.

Changes

New types and API

  • StdioSuggestion replaces StdinSuggestion — two modes: Piped (stdin=null, stdout/stderr piped into AsyncWrite streams) and Inherited (all three inherited from parent)
  • StdioConfig returned by LeafExecutionReporter::start() — contains the suggestion plus stdout_writer and stderr_writer async streams
  • Removed stdin_suggestion() and output(kind, content) from LeafExecutionReporter trait
  • Removed OutputKind from event.rs (only spawn.rs keeps its own OutputKind)

Reporter changes

  • Removed the W generic from all reporters (PlainReporter, LabeledReporterBuilder, LabeledGraphReporter, LabeledLeafReporter, SharedReporterState)
  • Display output (command lines, summaries, errors) written directly to std::io::stdout() using sync writes
  • tokio::io::stdout() / tokio::io::stderr() provided as the AsyncWrite streams in StdioConfig
  • PlainReporter returns tokio::io::sink() writers when silent_if_cache_hit && is_cache_hit

Execution flow

  • spawn_with_tracking() — stdin is always Stdio::null(), takes &mut dyn AsyncWrite for stdout/stderr instead of an on_output callback
  • New spawn_inherited() — inherits all three stdio FDs, no fspy tracking, just cmd.spawn() + wait()
  • Decision matrix: inherited mode only when suggestion is Inherited AND cache_metadata.is_none() (caching fully disabled)
  • Cache replay writes directly to StdioConfig writers
  • In-process execution writes to stdout_writer from StdioConfig

Test updates

  • Updated 8 stdio suggestion unit tests to use start() + assert StdioConfig.suggestion
  • Updated task-list E2E "vp run in script" test: inner vp run now sees a terminal (inherited stdout) and shows interactive selector — test uses expect-milestone + Enter to select and run a task

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@branchseer branchseer marked this pull request as ready for review February 15, 2026 12:40
…nsistency

The Statistics line in the execution summary had a trailing space that
was preserved on macOS but trimmed by Windows ConPTY. Also updates the
task-list 'vp run in script' E2E test to use expect-milestone + enter
instead of timing out.
@branchseer branchseer merged commit 4570ddf into main Feb 15, 2026
7 checks passed
@branchseer branchseer deleted the feat_improve_stdio_handling_with_async_writers branch February 15, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant