Skip to content

fix(engine): asset downloads stay on HTTP/1.1 under undici 8, as they do on undici 7 - #9084

Open
miguel-heygen wants to merge 1 commit into
mainfrom
fix/engine-downloads-http1
Open

miguel-heygen wants to merge 1 commit into
mainfrom
fix/engine-downloads-http1

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What changes for people

Asset downloads keep speaking HTTP/1.1, through a tunnel when a capture proxy is set, even when the engine runs with undici 8. undici 8 offers HTTP/2 by default; undici 7, which this repo pins, does not. Today nothing changes on the wire. An app that runs the engine with undici 8 (HyperFrames Desktop's render server does, for undici 8's fix of a crash on slowly read downloads) no longer needs to patch the engine to keep the same protocol, and a later undici 8 upgrade here cannot move downloads to HTTP/2 without anyone noticing.

How

  • allowH2: false on the two download dispatchers in packages/engine/src/utils/urlDownloader.ts: the direct Agent and the capture proxy's ProxyAgent.

Tests

  • New test in urlDownloader.restrictedNetwork.test.ts: through the capture proxy, against an origin that speaks both HTTP/2 and HTTP/1.1, the download completes and the origin sees HTTP/1.1.
  • fails without the fix: urlDownloader.restrictedNetwork.test.ts "stays on HTTP/1.1 through the proxy when the origin also speaks HTTP/2", when the engine runs on undici 8.13.0. On this repo's undici 7.30.1 it passes with or without the change, since undici 7 never offers HTTP/2. Run on a Linux machine with undici 8.13.0 swapped into the install: fails on main's downloader, passes here.
  • The whole test file passes 23 of 23 on undici 7.30.1, the new test 3 runs in a row, and the engine's tsc --noEmit is clean.
  • Not driven: the direct path without a proxy. Its dial goes only to a public address, so it can't be pointed at a local server; it gets the same one-word change.

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at dab3b57. Both files read; urlDownloader.ts around the two dispatchers read whole, the test file as hunks plus the surrounding describe block. Nothing was run.

What I checked:

  • The change is one option on each of the two download dispatchers (the direct Agent and the capture proxy's ProxyAgent). A search of packages/ finds no other dispatcher construction outside tests, so no download path is left offering HTTP/2.
  • The proxy's Pool factory still spreads the options it is given and only wraps connect, so the dropped-tunnel handling is unchanged.
  • The new test stands up an origin that accepts both protocols behind the same tunnel proxy, adds its name to the test certificate, and asserts the origin saw exactly one request on 1.1. Teardown closes the new server.
  • Body has the fails without the fix: line and says plainly that the test only goes red on undici 8; on the 7.30.1 pinned here it passes either way.

Notes, not blocking:

  • Until this repo moves to undici 8, CI here does not prove the two lines are needed. The test becomes the guard on the day of that upgrade, which is the stated purpose.
  • The direct (no proxy) path is not driven by a test, as the body says. Same one-word change.

Need: yes · Size: +27 −4, minimal · Reuse: extends the existing proxy test fixture · Simpler: no · Structure: fine
Risk: low; no wire change on the pinned undici.

— Rames

@github-actions

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 275 (base branch 273), smooth 72 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Newly passing (2)

  • seqscaletwice-scale-px-r0-root-z100
  • seqscaletwice-scale-px-r0-nested-z100

Not banked yet, reported and not gated (bank a full-grid run's baseline.json) (2)

  • seqscaletwice-scale-px-r0-root-z100
  • seqscaletwice-scale-px-r0-nested-z100

Quarantined, measured but not gated (0)

@miguel-heygen
miguel-heygen added this pull request to the merge queue Nov 29, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 29, 2026
@miguel-heygen
miguel-heygen added this pull request to the merge queue Nov 29, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 29, 2026

This branch has not been deployed

No deployments
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.

2 participants