Update to undici@7. - #58
Merged
Merged
Conversation
Aligns the installed undici with the one built into the current Node.js LTS release, per the policy of optimizing for current LTS. undici 7 is the transition release between the old (v6 `onError`) and new (v8 `onRequestStart`) dispatcher handler dialects, shipping both `wrap-handler` and `unwrap-handler` to translate in either direction. A v7 dispatcher is therefore usable by the `fetch` built into Node.js 22, 24, and 26 alike, so the legacy `agent`/`httpsAgent` options now use the platform `fetch` on every supported release and responses are platform `Response` instances again. Replace the strict installed-equals-platform major check with an explicit table of the platform majors each installed major can drive. An installed major with no entry falls back to requiring an exact match, so a missing or stale entry costs only the fallback path rather than correctness. The fallback is kept rather than removed: a future undici bump is expected to need it again, since a v8 dispatcher cannot be driven by the v7 `fetch` in Node.js 24. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
dlongley
approved these changes
Aug 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claude ran matrix tests on this. I guided it to leave in the fallback code since it's likely to be needed again. We could alternatively drop that for now and add back later. Also going straight to undici@8 could be done if there are performance or other reasons to do so, but that will always hit fallbacks for current LTS node@24 at the moment.
Robot commit message:
Aligns the installed undici with the one built into the current Node.js LTS release, per the policy of optimizing for current LTS.
undici 7 is the transition release between the old (v6
onError) and new (v8onRequestStart) dispatcher handler dialects, shipping bothwrap-handlerandunwrap-handlerto translate in either direction. A v7 dispatcher is therefore usable by thefetchbuilt into Node.js 22, 24, and 26 alike, so the legacyagent/httpsAgentoptions now use the platformfetchon every supported release and responses are platformResponseinstances again.Replace the strict installed-equals-platform major check with an explicit table of the platform majors each installed major can drive. An installed major with no entry falls back to requiring an exact match, so a missing or stale entry costs only the fallback path rather than correctness.
The fallback is kept rather than removed: a future undici bump is expected to need it again, since a v8 dispatcher cannot be driven by the v7
fetchin Node.js 24.