Skip to content

fix(npm): stream filtered output before exit - #3606

Open
maxjustships wants to merge 1 commit into
rtk-ai:developfrom
maxjustships:fix/npm-streaming-readiness
Open

fix(npm): stream filtered output before exit#3606
maxjustships wants to merge 1 commit into
rtk-ai:developfrom
maxjustships:fix/npm-streaming-readiness

Conversation

@maxjustships

Copy link
Copy Markdown

Summary

  • stream npm/npx output through RTK's existing line-filter pipeline instead of retaining stdout until child exit
  • preserve npm boilerplate/warning/progress filtering and the existing ok result when every line is filtered
  • add an integration regression that proves readiness stdout and meaningful stderr are observable while the npm script is still alive

Why

rtk npm used FilterMode::CaptureOnly, so a long-running npm script could emit a readiness receipt but its parent would not see that receipt until the child exited. This breaks dev servers, watchers, daemons, and agent orchestration that starts a background service before launching a dependent worker.

The npm filter is line-oriented, so it can use RTK's existing streaming abstraction without guessing which script names are long-running and without disabling filtering.

Fixes #3604.

Validation

  • cargo test --test npm_streaming_test
  • cargo test cmds::js::npm_cmd::tests
  • cargo fmt --all --check
  • cargo clippy --all-targets
  • cargo test — 2693 passed, 8 ignored
  • manual built-binary smoke: readiness appeared in the parent process output while the npm child remained alive
  • quiet-script parity: installed and patched binaries both returned ok\n, exit 0

@CLAassistant

CLAassistant commented Aug 19, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

npm filter buffers stdout until exit, breaking long-running readiness protocols

2 participants