Skip to content

fix(cli): ensure blocking stdio#2173

Draft
wan9chi wants to merge 1 commit into
agent/test-stdio-backpressure-e2efrom
agent/fix-blocking-stdio
Draft

fix(cli): ensure blocking stdio#2173
wan9chi wants to merge 1 commit into
agent/test-stdio-backpressure-e2efrom
agent/fix-blocking-stdio

Conversation

@wan9chi

@wan9chi wan9chi commented Jul 14, 2026

Copy link
Copy Markdown
Member

Summary

  • clear inherited O_NONBLOCK from non-TTY stdin, stdout, and stderr at process entry
  • call the helper from the global Rust CLI and once from the local NAPI entry
  • update the E2E snapshots from the normalized truncation failure to all 1,282 output lines, including the final 128-warning summary

Root cause

Node marks non-TTY stdio as non-blocking, and the flag is shared with inherited child descriptors. Rust's standard I/O and embedded dependencies assume blocking writes, so a full consumer pipe can return EAGAIN, truncate diagnostics, or panic.

This PR is intentionally scoped to restoring blocking stdio. It does not add write-site retries or io::Result propagation.

Fixes #2165.

Validation

  • cargo test -p vite_shared clears_nonblocking_from_a_non_tty_file_description
  • pnpm -F vite-plus build
  • just snapshot-test check_backpressure (local and global; repeated compare-mode runs)
  • just check
  • just lint
  • just test
  • git diff --check

Stack: 2 of 2. Depends on #2172.

wan9chi commented Jul 14, 2026

Copy link
Copy Markdown
Member Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add the label auto-merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

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

@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Native binary sizes (82821df)

Final release artifacts built by the canonical build-upstream and build-windows-cli actions.

Artifact Format Base PR Change
vp (Linux x64) Binary 10.32 MiB 10.32 MiB 0 B (0.00%)
vp (Linux x64) gzip -9 4.42 MiB 4.42 MiB +476 B (+0.01%)
NAPI (Linux x64) Binary 33.42 MiB 33.42 MiB 0 B (0.00%)
NAPI (Linux x64) gzip -9 12.78 MiB 12.78 MiB +502 B (+0.00%)
vp (macOS ARM64) Binary 7.64 MiB 7.65 MiB +16.13 KiB (+0.21%)
vp (macOS ARM64) gzip -9 3.83 MiB 3.83 MiB +333 B (+0.01%)
NAPI (macOS ARM64) Binary 40.78 MiB 40.78 MiB 0 B (0.00%)
NAPI (macOS ARM64) gzip -9 17.05 MiB 17.05 MiB -225 B (-0.00%)
vp (Windows x64) Binary 8.37 MiB 8.37 MiB 0 B (0.00%)
vp (Windows x64) gzip -9 3.64 MiB 3.64 MiB +1 B (+0.00%)
NAPI (Windows x64) Binary 27.88 MiB 27.88 MiB +512 B (+0.00%)
NAPI (Windows x64) gzip -9 10.78 MiB 10.78 MiB +20 B (+0.00%)
Trampoline (Windows x64) Binary 203.00 KiB 203.00 KiB 0 B (0.00%)
Trampoline (Windows x64) gzip -9 97.91 KiB 97.91 KiB 0 B (0.00%)
Installer (Windows x64) Binary 4.46 MiB 4.46 MiB 0 B (0.00%)
Installer (Windows x64) gzip -9 2.08 MiB 2.08 MiB 0 B (0.00%)

@wan9chi wan9chi force-pushed the agent/fix-blocking-stdio branch from 31fc7dc to 82821df Compare July 14, 2026 12:33
@wan9chi wan9chi force-pushed the agent/test-stdio-backpressure-e2e branch from aaa12f4 to 4bdb273 Compare July 14, 2026 12:33
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