Repository navigation
perf(pm): drop reqwest stream feature, stream download via Response::chunk - #3188
Conversation
…e::chunk` #3142 added live install progress using `response.bytes_stream()`, which requires reqwest's `stream` feature. #3183 (binary slimming) had removed that feature on a base that predated the call site, so once both landed on `next` the combination failed to compile (`E0599: no method bytes_stream`). #3187 fixed the breakage by re-adding the `stream` feature. But download progress never needed `stream`. `Response::chunk()` reads the body frame-by-frame with no feature gate, so it feeds the same per-chunk `DOWNLOADED_BYTES` counter the spinner renders. The body is still fully buffered before return (the extractor is not streaming), so this only buys the progress signal, not lower peak memory — identical behavior, one fewer feature. Revert #3187's `stream` feature (drops the wasm-only `wasm-streams` dep from the lock) and rewrite the download loop to use `chunk()`, dropping the `futures::StreamExt` import. Verified: cargo check -p utoo-pm, cargo clippy --all-targets -D warnings, cargo fmt all clean; Cargo.lock diff is the exact inverse of #3187. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request removes the stream feature from the reqwest dependency in crates/pm/Cargo.toml and removes the unused wasm-streams dependency from Cargo.lock. In crates/pm/src/util/downloader.rs, the code is refactored to use response.chunk().await instead of response.bytes_stream(), which avoids buffering the entire body at once while eliminating the need for the reqwest stream feature and the futures::StreamExt import. There are no review comments, so I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Background
crates/pm/src/util/downloader.rsreported live install progress viaresponse.bytes_stream()(added in #3142 / a9ee35b), which requires reqwest'sstreamfeature. #3183 (binary slimming) had removedstreamon a base that predated that call site, so once both PRs landed onnextthe combination failed to compile:#3187 unblocked
nextby re-adding thestreamfeature. This PR does it properly instead.Why progress never needed
streamreqwest::Response::chunk()reads the body frame-by-frame with no feature gate (onlybytes_stream()is#[cfg(feature = "stream")]). It feeds the exact same per-chunkDOWNLOADED_BYTEScounter the spinner renders as↓ 23.4 MB 8.2 MB/s.The body is still fully buffered before return — the downstream extractor is not streaming (the decompression path isn't incremental) — so
chunk()only buys the progress signal, not lower peak memory. Behavior is byte-for-byte identical: npm.tgzaren't transfer-gzip-encoded, so both paths count raw tarball bytes the same.Changes
streamfeature for download progress #3187'sstreamfeature (theCargo.lockdiff is the exact inverse of fix(pm): enable reqweststreamfeature for download progress #3187 — only the wasm-onlywasm-streamsdep is dropped; native binary size is unaffected).Response::chunk().futures::StreamExtimport.Verification
🤖 Generated with Claude Code