Skip to content

fix(network): port Headers, Undici, HTTP, and HTTPS compatibility fixes - #32

Merged
steipete merged 12 commits into
mainfrom
claude/port-ci-network
Sep 30, 2026
Merged

steipete merged 12 commits into
mainfrom
claude/port-ci-network

Conversation

@steipete

@steipete steipete commented Sep 30, 2026 •

Copy link
Copy Markdown

Port the CI-line Headers, Undici, HTTP, and HTTPS compatibility fixes. Custom Headers iterators now reach conversion callers, server.fetch owns its header copy, Undici preserves timeout metadata and heartbeat APIs, and Node HTTP/HTTPS gains the listen-error, byte-count, half-open, constructor, and ALPN behavior covered below. Preserve current proxy parsing and native TLS event/session ownership.

Original authors and cherry-pick provenance are retained as individual commits.

CI source Fork commit Fix Upstream PR/state
cb4d3b9b8b f0f3ad138b fix(node): preserve undici timeout error metadata #42716 OPEN
278105f25f 47e4efdc11 fix(undici): support WebSocket heartbeat APIs #37111 OPEN
f5234e318c 4c686f8e96 fix(fetch): honor custom Headers iterators #43023 OPEN
abc9dd2cf1 e821a89291 fix(node): format HTTP listen errors #42742 OPEN
7e480b3e65 5ea3c1459c fix(http): honor HTTPS server half-open policy #42855 OPEN
097d680c24 19e9b6e9ee fix(http): include raw socket writes in byte accounting Not separately identified
4bc81c1fd3 1398d15c0d fix(node:https): match Server constructor and ALPN #42576 OPEN
eafacd1508 46dbcd1bca test(node:https): nest PFX runtime matrix #42576 OPEN
05f2611fa0 cdcf03dede chore(rust): document ALPN FFI safety #42576 OPEN
Qualification / formatting adjustment b3171032ed style(http): format listen error forwarding Not separately identified
Qualification / formatting adjustment 45d6b54e68 test(tls): wait for server handshake completion before closing Not separately identified
Qualification / formatting adjustment 339edb7739 fix(http): declare server types for builtin module checks Not separately identified

Qualified together with the complete independent stack on darwin-arm64 at 828fba48faa28a56f15839c79f1c6d6838dd8405 using bun scripts/build.ts --profile=release, linked to unchanged WebKit f20ce7744553c910bcf16a33faf976af208de091. The release binary’s revision was verified before tests.

BUN_FEATURE_FLAG_INTERNAL_FOR_TESTING=1 BUN_GARBAGE_COLLECTOR_LEVEL=0 build/release/bun test <file> --max-concurrency 2

Test file Pass Skip Todo Fail
test/js/bun/http/bun-server.test.ts 82 1 0 0
test/js/first_party/undici/undici.test.ts 33 0 0 0
test/js/node/http/node-http-connect.test.ts 82 1 2 0
test/js/node/http/node-http-server-close-drain.test.ts 31 0 0 0
test/js/node/http/node-http-with-ws.test.ts 25 0 0 0
test/js/node/http/node-http.test.ts 280 1 0 0
test/js/node/tls/node-tls-server.test.ts 99 0 0 0
test/js/web/fetch/headers.test.ts 116 0 0 0
test/js/web/fetch/wpt/headers-basic-wpt.test.ts 23 0 0 0

Independent Codex review found no actionable P0/P1 findings. Local JavaScript lint and Rust/C++/TypeScript formatting checks passed. Cross-target Rust checking passed all 12 targets with release codegen inputs (0 failed, 0 skipped). No workflow or WebKit-pin changes.

CI built-in-module typechecking also required the internal allowHalfOpen declaration and explicit HTTPS constructor void return annotation; the corrected declarations pass locally and do not change runtime behavior. The existing 50-connection TLS fixture reproduced its client-close race on published baseline 7862bb3750 (4/30 failures). Letting the server finish its secureConnection callback before clients close preserves the exact count and ALPN assertions; the revised fixture passed 30/30 repeats on both baseline and candidate.

@steipete
steipete force-pushed the claude/port-ci-cli-process branch from 70d8fa5 to 1867ab0 Compare September 30, 2026 07:16
Base automatically changed from claude/port-ci-cli-process to main September 30, 2026 07:24
steipete and others added 12 commits September 30, 2026 00:25
Ports oven-sh#37111 into the OpenClaw compatibility build.

(cherry picked from commit 278105f)
Backport the complete HeadersInit guard and caller cutover from
oven-sh#43023 at b276ab8 onto
the fb7c integration line. The older source keeps FetchSession proxy parsing
inline in fetch.rs, so map that caller there.

Apply the same guarded conversion to server.fetch and clone its native header
list for Request ownership. This preserves the caller's Headers snapshot and
incorporates the matching ownership correction from oven-sh#40888 without
adopting the JS wrapper's borrowed reference.

(cherry picked from commit f5234e3)
(cherry picked from commit abc9dd2)
Keep response-body and raw transport byte counts together when reporting
server socket bytesWritten. A retained zero response-body count must not
hide writes made after a WebSocket upgrade.

Extend the existing immediate-send fixture to check the byte delta on fresh
and reused sockets. Source review and formatting passed; candidate runtime
validation remains pending.

(cherry picked from commit 097d680)
(cherry picked from commit 05f2611)
@steipete
steipete force-pushed the claude/port-ci-network branch from f6d06bd to 339edb7 Compare September 30, 2026 07:25
@steipete
steipete merged commit 6e1b475 into main Sep 30, 2026
9 checks passed
@steipete
steipete deleted the claude/port-ci-network branch September 30, 2026 07:33
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