Published CONNECT ownership repair
2c5df8cce is pushed on codex/runtime-port as Chris Breuer without coauthors; not merged to main. Passing the fixed CONNECT writer by reference now preserves its byte count. Detaching the accumulated CONNECT envelope before inner TLS prevents old proxy headers from being parsed as the upstream response; the detached allocation stays alive until its tail has been copied, and cleanup does not dereference a client after synchronous TLS failure could free it.
Both complete unchanged files now pass, matching pinned Bun:
- Split CONNECT envelope: 1/1 / 2 assertions, versus published parent 0 pass / 1 fail with child panic.
- SSLConfig intern race: 1/1 / 3 assertions, versus parent 0 pass / 1 fail / 1 assertion, child exit 134. The original five-second race and probe-count checks now run; none was removed.
An intermediate writer-only candidate still leaked the split envelope; that failure remains in compress-matrix-final3.json. The final native regression additionally checks split-envelope uploads for all four compression encodings, exact body/framing, certificate rejection and recovery. Normal, VM destruction/JSC exception-check and complete regression runs pass.
Shared verification with #531: native build 17/17, units 1,827 pass / 19 skip / 0 fail, regressions 60/60, full body-stream 9,086/9,086. Evidence: zig-out/compress-matrix-{parent4,final5,release4}.json, compress-native5.json, compress-native-destruction5.json, compress-publication.json, and the native runtime documentation. Sources remain byte-identical to the pin; failed attempts are retained.
This issue stays open for platform/integration verification. TLS ownership work remains #532 and intermittent HTTP/3 uploads are separate #539. #66 is not complete.
Historical reproduction
Published reproduction checkpoint
fd239c3ac fixes #533, but does not repair this CONNECT failure. Both proxy files fail in published parent 29c196835 and this checkpoint; pinned Bun passes both. Full source/log evidence is below.
Parent: #66. Found while verifying #533; related TLS ownership work: #532. Keep separate from HTTP/2 header and session-key parity.
Reproduction
With the complete, byte-identical pinned tests (Bun source 4982b91e3702094330f3be3883354c52b8c01323):
js/web/fetch/fetch-proxy-connect-tunnel-split-envelope.test.ts: published Home parent29c196835and the HTTP/2 candidate both fail 0 pass / 1 fail. Their child panics atHTTPClient.onWritable(http.zig:1708) when the CONNECT request headers have been sent with an empty ordinary request body. The test receives empty stdout. Pinned Bun passes 1/1 / 2 assertions.js/web/fetch/fetch-proxy-tls-intern-race.test.ts: both Home artifacts fail 0 pass / 1 fail / 1 assertion, with child exit 134 at the same assertion. Pinned Bun passes 1/1 / 3 assertions, retaining the original five-second race workload and probe-count checks.
This is a pre-existing failure reproduced independently of #533. The repeated C frames in the diagnostic are not proof of recursion (the trace reports potentially broken debug information). Trace the CONNECT state/body accounting against pinned Bun, preserve split-envelope parsing and proxy/tunnel ownership, and rerun both complete files without relaxing deadlines or sanity checks. An assertion removal alone is not a logical fix. Keep testing the actual SSLConfig race after the early panic is repaired; the race test currently cannot exercise its full workload in Home.
Evidence: zig-out/h2-matrix-{parent3,final3,release3}.json and adjacent full stdout/stderr files. All tested sources and the race subprocess fixture are byte-identical to the pin (h2-source-integrity.json). Native Darwin debug execution only; other platforms and full parity remain unverified.