Repository navigation
docs(link): move the link WebSocket gate-opening work to a devlog unit, and make the fingerprints test assert the exact count after each change of state - #8679
Merged
Conversation
…o present limits and no open work
…ket comments and point open work at the devlog unit
…sserts the exact mark count after it
…ex (refused counts like a 503)
Contributor
|
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. |
Contributor
|
✅ Deterministic PR hygiene checks passed. |
… the same leg, including a ping from Codex
…easurement are skipped
… a mismatch and which still time out
…a stop, and the Child is stricter on its own oversized close
…xes and the claim until one is measured
…etry budget, and the restart claim is conditional
…e turn and for returning to the WebSocket
…vertisement; bring it the try-when-unknown rule
4 tasks done
… the relay's 503, whose retry budget is not measured
…x-child-followups # Conflicts: # structure/remote-link.md
…s while the relay drains
…and the route-intent poll is a preflight too
…x-rs, with its source
…ebSocket paragraph
… handles the old listener's 503
…, not the only one
…x-child-followups
… Codex's retry budget
…op, besides the handshake fallback
…among the first answers
…TTP 503 retry is read from the Codex source
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. |
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.
Summary
Follow-up to #8653 (the link WebSocket in
ocx-child), #8658 (the TypeScript Child's restart drain) and #8675 (the fingerprints test), from their final reviews. Documentation, comments and one test; no behaviour changes.A devlog unit for open work.
devlog/_plan/261113_link_websocket_gate_opening/000_plan.mdlists what the change that opens each Child's link WebSocket gate still has to carry.ocx-child: the control-frame deadline, reaper wakeups, Autobahn, RSS acceptance, pinned-Codex scenarios, a pure-move split oflink_ws.rs, the Child-local opt-out, macOS and Windows runs, user docs, the state-proof vectors in the Rust CI path filter, and the TypeScript Child's "no answer yet means try" rule (feat(link): try the WebSocket upgrade when the Child has no answer from its Home yet (closed gate) #8682), sinceocx-childstill answers 426 until a preflight has taught it the Home's advertisement.home_unreachablewith Retry-After, and that how Codex retries that 503 over HTTP was read from the Codex source at 88c5856, not measured: request-level and then turn-level retries, each waiting for Retry-After, then the turn fails; a 5 s window fits inside that budget at the defaults.server.stop(false)is called. It gives the two ways to shorten that window, to choose once that window has been measured. It also gives the claim until then, with the item's conditions: a Child restart ends a running turn's WebSocket session unless the replacement accepts the upgrade within Codex's retry budget, and Codex then sends the turn over HTTP. That request reaches the replacement only if Codex's retries outlast the old listener's 503s, and it completes only if the replacement's tunnel and the Home serve it. A later session returns to the WebSocket when the replacement's cache holds on (or no answer yet) and that upgrade's own preflight answers on.The structure doc states only what holds today.
structure/remote-link.mdno longer lists open work forocx-child(structure docs are present tense; open work belongs indevlog/). It keeps the two present limits:idleTimeout: 0), but a ping from Codex is answered on Codex's leg and meets the same limit. A close is not affected: every close write follows a close bound of at most 5 s (1 s on a stop), which the reaper enforces first. Whether the pinned codex-rs pings is to be checked before the gate opens (devlog item 1).The TypeScript Child paragraph no longer says the restart drain keeps Codex's WebSocket session unconditionally: each 503, and each refused connection while no listener is bound, spends one of Codex's stream retries, so the session stays on the WebSocket only when the replacement accepts within that budget. It also says that a failed local upgrade Bun had already opened counts as a stop, and that for Bun's own oversized-message 1006 the Home receives 1011 and counts it complete, so the Child is stricter there.
No comments pointing outside the repository. The
ocx-childlink WebSocket modules (link_ws.rs,link_ws_advert.rs,link_ws_frame.rs,tests/link_websocket.rs) lose the design-addendum and lane labels ("draft 9", U1, V1, U4, X1, Y1, S2/S3, V2, R6, C7, S4, T6-4) that referred to notes outside the repository. Each comment keeps what it describes, and the module header points at the devlog unit. "design T4" references stay; the TypeScript code uses them too. Comments only.The fingerprints test asserts the exact count after each change of state. Since test(server): wait for the activity holds state, not for one file event, in the link WebSocket fingerprints test #8675, every wrong mark count in "through a real Home: a cut WebSocket turn and its HTTP resend" failed as a 5 s timeout at the wait. The waits are now for a change of state, with the exact count asserted after them: wait until the holds file exists, then expect 1; after a resend answered 200, wait until the count is no longer 1, then expect 0. A holds file first written with a wrong count, or a 200 resend that moves the count to anything but 0, now fails as a mismatch. A holds file never written, or a count that stays 1 after the resend, still fails at the runner's timeout. The waits keep test(server): wait for the activity holds state, not for one file event, in the link WebSocket fingerprints test #8675's shape (one watcher armed before the Home starts; each wait checks its condition when it starts and on every event).
Merged with dev after feat(link): try the WebSocket upgrade when the Child has no answer from its Home yet (closed gate) #8682 and test(link): pin the Child relay wait observer across Home failures, queued aborts and cancels, and correct its comments #8683. Two normal merges of dev:
5caeeaff1(after feat(link): try the WebSocket upgrade when the Child has no answer from its Home yet (closed gate) #8682) and2df5d2baf(after test(link): pin the Child relay wait observer across Home failures, queued aborts and cancels, and correct its comments #8683; no conflict). The first had one conflict, in the TypeScript Child paragraph ofstructure/remote-link.md, resolved as dev's paragraph (from feat(link): try the WebSocket upgrade when the Child has no answer from its Home yet (closed gate) #8682) plus this PR's three edits: a failed upgrade that Bun had already opened counts as a stop; the drain keeps the WebSocket only within Codex's retry budget; and the 1006 and oversized-close counting. After the merge, that paragraph also says:The
machine-listener.tscomment says a cached off still tries while the relay drains.What keeps it inert: nothing here changes runtime code. The Rust edits are comments, and the test change only changes what the test waits for.
Verification
bun test tests/server/link-websocket-fingerprints.test.ts, 5 runs in a row: 29 pass, 0 fail each3960dd809:cargo fmt --manifest-path native/ocx-child/Cargo.toml --checkexit 0;cargo clippy --locked --manifest-path native/ocx-child/Cargo.toml --all-targets -- -D warningsexit 0;cargo test --locked --manifest-path native/ocx-child/Cargo.tomlexit 0 (54 lib tests). Atade59424e, after the commit that changes one//!line intests/link_websocket.rs:cargo fmt --checkexit 0.ade59424e(after the test-comment and Rust-comment changes; the five commits that followed it edit onlystructure/remote-link.mdand the devlog unit):bun run typecheckexit 0;bun scripts/test.ts --parallel=2overtests/server/link-websocket-fingerprints.test.ts,structure-ssot,test-layout,file-size-ratchetandlink-boundary: exit 0, 92 pass, 0 fail.2df5d2baf(after both dev merges and the commits that answer the final review ofb7e41a87d):bun run typecheck,bun run structure:check,bun run privacy:scanandcargo fmt --manifest-path native/ocx-child/Cargo.toml --checkeach exit 0;TMPDIR=/tmp bun scripts/test.ts --parallel=2overtests/server/link-websocket-fingerprints.test.ts,tests/clients/link-ws-unknown-try.test.ts,link-ws-advertisement,client-machine-listener,link-relay-wait-observer,link-boundary,test-layout,test-layout-tooling,file-size-ratchet,structure-ssotandrepo-hygiene: exit 0, 190 pass, 0 fail.b7e41a87d(which adds devlog item 11 in3317975c7and qualifies it):bun run structure:checkandbun run privacy:scaneach exit 0.2df5d2baf, one of them a one-line comment insrc/client/link-websocket.ts):bun run typecheck,bun run structure:checkandbun run privacy:scaneach exit 0;TMPDIR=/tmp bun scripts/test.ts --parallel=2overstructure-ssot,file-size-ratchetandlink-boundary: exit 0, 61 pass, 0 fail.3960dd809:bun scripts/test.ts --parallel=2over everylink-websocket-*.test.tsfile (tests/server and tests/e2e-style),tests/responses/responses-websocket-workflow-ceiling.test.ts, the two ocx-child Cargo wrappers, and the layout, layout-tooling, structure-ssot, file-size and repo-hygiene guards: exit 0 (267 pass, 9 skip, the release-gate cases that need the pinned codex-rs binary, 0 fail).Review: a gpt-6.1-terra reviewer (xhigh, read-only) reviewed the first four commits (no findings) and then the devlog correction for the measured restart facts (no findings). A fresh gpt-6.1-terra reviewer (xhigh, read-only) then reviewed the final-review fixes over three rounds. Round 1 found the restart claim and the structure drain sentence unconditional (P2); round 2 found the claim still stated outcomes, not conditions (P2). Both are fixed; round 3 had no findings. Round 4 reviewed the added
ocx-childitem 11, requested by #8682's final review: no P0-P2, and its one P3 (the TypeScript rule as cited omitted the drain exception for a cached off) is fixed. Rounds 5 and 6 reviewed the answers to the final review ofb7e41a87d: the merge resolution, N1 and N2, P3-A to P3-D and the devlog updates. Round 5 found that reaching the replacement over HTTP was stated as guaranteed (P2) and that the route-intent poll was named as the only first source of an answer (P3); both are fixed, and round 6 had no findings. The final review of2df5d2baf(approve with nits) listed nine wording P3s. They are fixed in the last five commits and in this text, which the coordinator read in place of another terra round:src/client/link-websocket.tssays "within its retry budget";drainingduring a restart drain;Open P0-P2: 0.
NOT RUN: clippy and cargo test at the final head (the only Rust change since
3960dd809is one doc-comment line; CI's ocx-child step runs both); macOS (where #8675's race occurred; the waits keep its shape); the fullbun run testsuite.Checklist