You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
0.22: reduce the core app-source downloader’s Undici footprint #4674
Reduce the default install size under #4591 while retaining the existing app-source download contract. The current package report shows a 518,980-byte undici.js. The packed importers are Limrun’s SDK tunnel code and the provision-kit downloader. Limrun (#3311) and Maestro keep their plugin-owned dependencies.
Trace requestApprovedUrl and measure a narrower maintained transport against the current bundle. Compare an upstream entry or existing Node APIs before considering a vendored subset. If vendoring wins, account for the license, upstream version and update ownership.
Preserve the existing streaming response and cleanup interface, approved-address pinning, TLS hostname verification, scoped proxy/NO_PROXY, redirect validation, header handling, byte limits, cancellation and error behavior. Keep downloader tests intact and verify the actual packed public path.
Compare equivalently prepared core tarballs and fresh installed footprints, including dependencies. Record unpacked and download bytes plus package/module attribution. Proceed with implementation only when a material saving and contract parity are demonstrated.
Source and test inventory can start independently. Final size attribution requires the Limrun branch or merged #3311 so its dependency is outside the measured core.
The issue requests a new optimization: shrinking the default Undici footprint for the core app-source downloader while preserving existing download behavior. It provides a concrete target file size, affected importers, and explicit verification steps, so a maintainer could act on it.
Current state: the static bundle probe confirms the 518,980-byte shipped Undici chunk is shared by Limrun and the core app-source downloader. Deep Undici imports still bundled roughly 308 kB in the probe and rely on internal entrypoints. A supported Node HTTP transport is the next candidate. Apex is characterizing the existing behavior with loopback tests before trying a local replacement. Preserve pinned address and TLS identity, both HTTP and HTTPS CONNECT, scoped proxy rules, existing timeout behavior, and cancellation and socket cleanup. Keep the original transport if matching it requires a larger or less maintainable implementation. The provisional saving is approximately 0.5 MB unpacked after #3311. A matched pack comparison is still required.
Decision on the error contract for the Node HTTP(S) downloader:
Keep COMMAND_FAILED with details.networkErrorCode. Node system codes pass through unchanged (ECONNRESET, ECONNREFUSED, ENOTFOUND, ETIMEDOUT, TLS codes).
Timeouts get transport-independent codes owned by agent-device: connect-timeout, header-timeout, body-timeout. No Undici-specific code (UND_ERR_*) stays in the contract.
Caller cancellation stays a separate outcome and never reports a timeout code.
A failure before headers and a failure while the body streams report the same field. The body path also removes the partial file, as today.
Acceptance: tests for each code before headers and during the body through the download command, and the matched package size comparison.
Order: after the Limrun extraction (#3311) removes the other Undici consumer from core, so the size comparison measures the real saving.
Status: not started in this round. Decision recorded earlier: keep details.networkErrorCode; Node codes pass through; agent-device timeout codes are connect-timeout, header-timeout, body-timeout; cancellation is separate. It is sequenced after the Limrun extraction (#4846) merges.
Activity
apex-sentinel-staging commentedon Nov 18, 2026
Apex Sentinel · Issue review
Suggested label:
featureThe issue requests a new optimization: shrinking the default Undici footprint for the core app-source downloader while preserving existing download behavior. It provides a concrete target file size, affected importers, and explicit verification steps, so a maintainer could act on it.
thymikee commentedon Nov 18, 2026
Current state: the static bundle probe confirms the 518,980-byte shipped Undici chunk is shared by Limrun and the core app-source downloader. Deep Undici imports still bundled roughly 308 kB in the probe and rely on internal entrypoints. A supported Node HTTP transport is the next candidate. Apex is characterizing the existing behavior with loopback tests before trying a local replacement. Preserve pinned address and TLS identity, both HTTP and HTTPS CONNECT, scoped proxy rules, existing timeout behavior, and cancellation and socket cleanup. Keep the original transport if matching it requires a larger or less maintainable implementation. The provisional saving is approximately 0.5 MB unpacked after #3311. A matched pack comparison is still required.
thymikee commentedon Nov 20, 2026
Decision on the error contract for the Node HTTP(S) downloader:
COMMAND_FAILEDwithdetails.networkErrorCode. Node system codes pass through unchanged (ECONNRESET,ECONNREFUSED,ENOTFOUND,ETIMEDOUT, TLS codes).connect-timeout,header-timeout,body-timeout. No Undici-specific code (UND_ERR_*) stays in the contract.Acceptance: tests for each code before headers and during the body through the download command, and the matched package size comparison.
Order: after the Limrun extraction (#3311) removes the other Undici consumer from core, so the size comparison measures the real saving.
thymikee commentedon Nov 20, 2026
Status: not started in this round. Decision recorded earlier: keep
details.networkErrorCode; Node codes pass through; agent-device timeout codes areconnect-timeout,header-timeout,body-timeout; cancellation is separate. It is sequenced after the Limrun extraction (#4846) merges.fix(provision-kit): restore SOCKS proxy support in the Node download …