Commit 4176c4c
committed
feat: add stdin suggestion to reporter for spawned tasks
Add StdinSuggestion enum to LeafExecutionReporter trait so reporters can
suggest whether child processes should inherit stdin or use /dev/null.
PlainReporter always suggests inherited stdin (single synthetic execution).
LabeledReporter suggests inherited only when the graph has exactly one
spawn leaf (computed via count_spawn_leaves at build time).
The actual stdin is inherited only when BOTH conditions hold:
- Reporter suggests Inherited
- Task has no cache metadata (caching disabled)
This prevents non-deterministic user input from corrupting cached output
while allowing interactive stdin for single uncached tasks.
Includes 15 unit tests for stdin suggestion logic and 3 E2E snapshot
tests verifying stdin inheritance/null behavior end-to-end.1 parent 0340b6c commit 4176c4c
13 files changed
Lines changed: 472 additions & 5 deletions
File tree
- crates
- vite_task_bin/tests/e2e_snapshots/fixtures/stdin-inheritance
- packages/other
- snapshots
- vite_task_plan/src
- vite_task/src/session
- execute
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
255 | 267 | | |
256 | 268 | | |
257 | 269 | | |
| |||
260 | 272 | | |
261 | 273 | | |
262 | 274 | | |
| 275 | + | |
263 | 276 | | |
264 | 277 | | |
265 | 278 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| |||
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| 75 | + | |
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
| |||
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
93 | | - | |
| 95 | + | |
94 | 96 | | |
95 | 97 | | |
96 | 98 | | |
| |||
0 commit comments