fix(install): answer the direct lookup in the shape Node asks for (#2840) - #2844
Conversation
…llstack#2840) The direct install-source dispatcher pins the connection to the approved address through a custom lookup that always answered with a single address. Node 20+ enables network family autoselection by default and calls lookup with `all: true`, expecting an array, so every direct download failed with ERR_INVALID_IP_ADDRESS before a socket opened. Proxied downloads were unaffected. The lookup now returns `[{ address, family }]` when asked for all addresses and the single-address form otherwise, matching the maestro runScript dispatcher. The approved address is still the only one it ever returns. Closes callstack#2840 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
615feac looks ready to merge. The direct lookup now returns the shape Node expects, matching No CI signal exists yet on this PR to report. Not blocking: the new lookup block in packages/provision-kit/src/install-source-network-transport.ts#L59 is byte-for-byte the same fix |
Summary
install-from-source <url>failed on every direct (non-proxied) download.directDispatcherpins the socket to the approved address with a custom lookup that always answeredcallback(null, address, family). Node 20+ autoselects the network family by default and calls lookup withall: true, which expects an array. The connection then threwERR_INVALID_IP_ADDRESSbefore any socket opened.The lookup now answers
[{ address, family }]whenoptions.allis set and the single-address form otherwise. This is the same shape the maestro runScript dispatcher (packages/maestro/src/daemon-port/run-script-http.ts) already uses. The address check from #1692 is unchanged: the lookup still returns only the approved address.2 files touched (source + its colocated test). No scope expansion.
Closes #2840
Validation
Tested at
615feacaf:approved.invalid, so it only resolves through the pinned lookup. It failed before the fix withInvalid IP address: undefinedand passes after.NODE_OPTIONS=--no-network-family-autoselection(single-address path) and withHTTP(S)_PROXYset in the environment.::1, and a real HTTPS GET toapi.github.compinned to its resolved IP. TLS validated against the hostname and the request returned 200.pnpm check:affected --run: all runnable checks passed (362 files, 2274 tests).Remaining risk: no live
install-from-sourcerun on a device. #2842 blocks the full end-to-end install after the download step.🤖 Generated with Claude Code