Repository navigation
refactor(vt): split piped and inherited spawn handles and drop dead fspy branch - #1021
Merged
wan9chi merged 3 commits intoNov 26, 2026
Merged
Conversation
fspy benchmarklinuxmacoswindows |
…spy branch - Replace `SpawnStdio`, `fspy: bool`, and `ChildHandle`'s parallel `Option<ChildStdout>` / `Option<ChildStderr>` with `PipedMode` (`Plain` | `Tracked`), coupled `ChildPipes`, `PipedChild`, `InheritedChild`, `spawn_piped`, and `spawn_inherited`. - Remove the dead `SpawnStdio::Inherited` arm from `spawn_fspy` so inherited stdio and fspy tracking cannot be combined at the type level. - Consolidate spawn, pipe drain, and IPC driving in `ExecutionMode::spawn_and_run` with `run_piped_child` and `wait_child`, removing `ExecutionMode::spawn_config`, `RunHandles`, `IpcHandles`, and both `.take().expect(...)` unwraps in `execute/mod.rs`. Co-authored-by: Gemini 4 Neon <noreply@google.com>
…unwrapping
- Have `ExecutionMode::spawn_and_run` consume `self` and return a
mode-typed `RunOutcome` (`Cached { state, outcome, ipc_result }` |
`Uncached { outcome }`), eliminating the `(ChildOutcome, Option<Result<Reports, _>>)`
cross-product and the second `match mode` in `run()`.
- Drop `stop_accepting: Option<&StopAccepting>` from `run_piped_child` and
signal `stop_accepting` directly alongside `tokio::join!` with the IPC
driver in the `Cached` arm.
- Extract `take_pipes` in `spawn.rs` so the `Stdio::piped()` unwrap
invariant is stated once, and tighten inline comments in `execute/mod.rs`.
Co-authored-by: gemini-4-neon <noreply@google.com>
wan9chi
force-pushed
the
refactor/vt-spawn-mode-and-pipes
branch
from
November 26, 2026 02:22
b65015b to
62db3c6
Compare
Co-authored-by: gemini-4-neon <noreply@google.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.
Motivation
The process-spawning boundary in
crates/vt/src/session/execute/represented coupled stdio and tracking invariants as independent booleans andOptions:ChildHandlestored parallelstdout: Option<ChildStdout>andstderr: Option<ChildStderr>, allowing half-piped states and forcing two.take().expect("SpawnStdio::Piped yields a ...")unwraps inrun_childto pair the handle back withOption<PipeSinks>.ExecutionMode::spawn_config()returned(SpawnStdio, bool), making the invalid(SpawnStdio::Inherited, true)(inherited stdio + fspy) combination representable and leaving a deadSpawnStdio::Inheritedbranch insidespawn_fspy.RunHandlesstored independentsinks: Option<PipeSinks>andipc: Option<IpcHandles>, even though cached execution always has both and uncached inherited execution has neither.Changes
SpawnStdio,fspy: bool,ChildHandle, andspawn()incrates/vt/src/session/execute/spawn.rswithPipedMode(Plain|Tracked), coupledChildPipes,ChildWait,PipedChild,InheritedChild,spawn_piped, andspawn_inherited.SpawnStdio::Inheritedarm fromspawn_fspyso inherited stdio and fspy tracking cannot be combined at compile time.ExecutionMode::spawn_and_run(withrun_piped_child,wait_child, andTracking::injected_envs), removingspawn_config,RunHandles,IpcHandles, and both.take().expect(...)unwraps incrates/vt/src/session/execute/mod.rs.Stack created with GitHub Stacks CLI • Give Feedback 💬
Note
Medium Risk
Touches the core cached-task path where child I/O and IPC are polled together; behavior is preserved but concurrency and cache-update wiring moved.
Overview
Refactors the vt task spawn pipeline so stdio mode, fspy tracking, pipes, and IPC are expressed with types instead of separate flags and
Options.Spawn layer (
spawn.rs): Replaces the singlespawn()/ChildHandle/SpawnStdioAPI withspawn_pipedandspawn_inherited, returningPipedChild(pairedChildPipes+ wait) orInheritedChild. Piped fspy usesPipedMode::Plain|Trackedonly on the piped path, removing the unreachable inherited+fspy branch inspawn_fspy.Execute layer (
mod.rs): Moves spawn, pipe drain, and (when cached) concurrent IPC polling intoExecutionMode::spawn_and_run, yielding mode-typedRunOutcomeso uncached runs cannot carry IPC reports and cached runs must. DropsRunHandles,IpcHandles, andspawn_config; splitsrun_childintorun_piped_childandwait_child.Tracking::injected_envscentralizes env injection for cached children.Reviewed by Cursor Bugbot for commit d0b97c8. Bugbot is set up for automated code reviews on this repo. Configure here.