Repository navigation
fix(link): link WebSocket readiness follow-ups: settled memory acceptance, the Home counts link sockets, and the review nits of #8622 and #8625 - #8647
Conversation
… read slots on an unpaced one
… outbound body denies every tool, not the parsed body
…ed helper, so a throwing end never keeps the lease
…k or recovery builds the next one
…nput with the frame
…ic book with the Child's definition
…indow, and fails a load that does not settle
… window settles them (#8600)
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
✅ Deterministic PR hygiene checks passed. |
…ys where completeness differs
…as well as whether the body denies every tool
…me's traffic book
…dds to the RSS fixture
… its WsData, as every upgraded socket does #8415 added a test that hands sendResponseToWebSocket a socket with no data. Every socket the shared Responses server upgrades carries a WsData object (the Responses socket, the live sideband, the Remote Workspace agent and the link gate all pass data to server.upgrade), and the bridge already reads ws.data on its other paths, so the socket in the test is what was wrong; since the Home counts link socket traffic, sendTextFrame reads ws.data.link on every send and the test threw.
|
Maintainer integration record for this squash merge.
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Correction to my integration record above. The longer comparison has finished: 30 fresh-copy runs of the nine link WebSocket test files on each tree gave 28 pass and 2 fail on the merge tree, and 28 pass and 2 fail on plain dev 3762722 (before this PR). Every failure is the same case in |
scripts/test-layout/layout.json: both sides appended to the explicit map; the union keeps link-websocket-traffic.test.ts from #8647 and link-gate-codex-binary.test.ts from this branch. tests/fixtures/test-layout-expected.json auto-merged to the same set.
Summary
These are the follow-ups from the final reviews of #8622 and #8625, plus two items required before the PR that opens the link WebSocket release gate (
linkWebsocketTransportReady). Nothing here opens the gate. Each item is its own commit.The branch merges dev at 6f58f62 with a normal merge commit (no conflicts). That dev carries a test from #8415 that hands
sendResponseToWebSocketa hand-made socket with nodata; once the Home counts link socket traffic,sendTextFramereadsws.data.linkon every send, so that test threw. Every socket the shared Responses server upgrades carries aWsDataobject, and the bridge already readsws.dataelsewhere, so the fix gives the test's socket adataobject and production code gains no guard.tests/e2e-style/link-websocket-rss.test.ts,OCX_LINK_WS_RSS_ACCEPTANCE=1) cut each run at the first moment every reader was waiting. That moment can come before the load's sustained stall. Because the peak (VmHWM) is read after the cut, a WebSocket run cut early reported a lower peak and passed more easily.tests/fixtures/link-ws-rss-home.ts) now announces the stall only after a 2.5 s quiet window in which every reader stays waiting andVmHWMdoes not rise; either break restarts the window.idleTimeout: 0, so a held stream is not cancelled during the window.structure/remote-link.mdnow states that the four earlier runs recorded under fix(link): the link WebSocket's memory acceptance passes: a link socket no longer re-serializes its create, and the HTTP relay reports its own stall #8625 are not release evidence, and records three settled runs on 2e8b3f3.sendTextFrame). A send Bun dropped is not counted.src/link/traffic.tssay so.src/lib/paced-stream.ts,src/server/responses/bare-namespace-aliases.ts,tests/responses/stalled-reader-memory.test.ts,tests/server/link-websocket-holds.test.ts,tests/routing/combo-stream-preflight.test.ts) already end cleanly on dev. The two files this PR touches that ended with a blank line (src/server/index/link-websocket.ts,tests/fixtures/link-ws-rss-home.ts) no longer do.Settled canonical acceptance, 24 sockets, single runs on commit 2e8b3f3, 4-core Linux VM, kernel
VmHWM, peak over idle per socket:The reservation (32 MiB), the budget (768 MiB) and the cap (24 sockets) are unchanged.
What stays unchanged by default:
Refs #8600
Verification
Red first. Each test in this list failed before its commit for the stated reason:
tests/routing/combo-stream-preflight.test.ts: with one event-loop turn after each read, the old test saw the replay take the next slot ahead of the client (expected 2, received 0).tests/responses/stalled-reader-memory.test.ts: changing the parsed outbound body after the required-tool check was built flipped its answer (expected true, received false), because the check still read the body.tests/server/link-websocket-holds.test.ts: a flow end that throws on the body paths ("end failed"), so the lease was kept.tests/server/link-websocket-pump.test.ts: a test observer that throws broke the relayed body ("observer failed").tests/server/link-websocket-traffic.test.ts(new): a link socket counted nothing, with zero requests and zero bytes.tests/server/link-websocket-transport-status.test.tsnow asserts exact counts through a real Home, and failed on the base, which counted zero.These tests pass before and after their commits; they pin behaviour that was already right:
tests/usage/request-decompress.test.ts: the binding test for review item 4 (a parsed create stays with its own request).tests/server/link-websocket-traffic.test.ts, "a refused or failed upgrade counts nothing": an unauthorized upgrade (401,server.upgradenever reached) and a failed one (426,server.upgradereached once and returning false) leave zero requests and zero bytes. A temporary mutation that begins the flow before the gate's checks turned it red, together with the first two traffic tests; the mutation was reverted.The settle deadline was exercised by temporarily setting it to 200 ms: the run failed with "the load did not settle".
Commands (Bun 1.4.4, TMPDIR=/tmp):
bun run typecheck,bun run privacy:scan,bun run structure:checkandgit diff --check origin/devexit 0;bun scripts/test.ts --parallel=2overresponses-websocket-workflow-ceiling.test.ts, alltests/server/link-websocket-*.test.ts(traffic and transport-status included), the two layout tests, link boundary, structure and file-size ratchet: 14 files, exit 0, 245 pass, 0 fail; and over the 25 test files that build a socket withas unknown as ServerWebSocket: exit 0, 1019 pass, 0 fail. Without the test fix the merged head fails the workflow ceiling test withTypeError: undefined is not an object (evaluating 'ws.data.link').bun run typecheck,bun run privacy:scan,bun run structure:checkandgit diff --check origin/devexit 0, andbun scripts/test.ts --parallel=2over 21 files (the link server tests,link-traffic.test.tsandlink-traffic-child-status.test.ts,stalled-reader-memory.test.ts, the combo required-tool suites, the RSS test skipped without opt-in, the lab, link and core-link boundaries, layout, structure and file-size ratchet) exit 0, 452 pass, 2 skip, 0 fail. The commits after b7c8018 change comments, structure pages, one test file and two trailing blank lines.bun scripts/test.ts --parallel=2over 52 files, exit 0, 1408 pass, 2 skip, 0 fail: the link server tests,stalled-reader-memory.test.ts, the combo preflight and required-tool suites,request-decompress.test.ts, the core module boundaries, the WebSocket endpoint tests,link-traffic.test.ts, the RSS test (skipped without opt-in), the lab and link boundaries, layout, structure and file-size ratchet.OCX_LINK_WS_RSS_ACCEPTANCE=1 bun test tests/e2e-style/link-websocket-rss.test.ts: three times on 2e8b3f3, one at a time, all exit 0 (table above).NOT RUN:
bun run testsuite: this VM is limited to focused files with parallelism 2.Checklist