Repository navigation
fix: stabilize live-text subscription fixture - #186330
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR completes the live-text fixture’s Gateway handshake and waits for subscription requests to be sent before processing them. Example: The fixture subscribes observers first and second to agent:main:chat, then unsubscribes first.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it is maintainer-authored and repairs a concrete fixture failure without changing production behavior or weakening the existing regression assertions. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe fixture connects the real browser client to a mocked WebSocket and feeds subscription parameters into the real subscriber registry, then checks live-text broadcasts and reconstructed browser events. flowchart LR
A[Live text fixture] --> B[Browser client]
B --> C[Protocol handshake and requests]
C --> D[Mock WebSocket]
D --> E[Subscriber registry]
E --> F[Broadcast owner]
F --> B
Technical reviewBest possible solution: Retain the fixture-only repair using the existing handshake helper and request owner’s onSent callback. Do we have a high-confidence way to reproduce the issue? The base fixture opens its socket without challenge or hello, then immediately reads a request that the protocol owner holds until readiness; this explains the reported undefined-params failure without executing target code. Is this the best way to solve the issue? The patch repairs the fixture at its owner, reuses established handshake and send-completion contracts, and preserves the original behavioral assertions without new production machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2e628e80c294. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests 0. Total 0 across 1 file. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 27, 2026, 5:46 PM ET / 21:46 UTC. |
|
Fixed: the live-text subscription fixture now completes its browser handshake and settles the exact subscribe or unsubscribe request it observes. |
Stabilizes the live-text subscription fixture by completing its browser handshake and correlating registry updates and responses with each actual request frame.
What Problem This Solves
Fixes: the live-text broadcast fixture can inspect an absent WebSocket frame when it exercises subscription changes through the real asynchronous browser client. The fixture opened the socket without completing the required Gateway challenge/hello handshake, so the client correctly held the subscription request while the fixture immediately tried to read its parameters. That primary failure also left the request pending until teardown, producing a secondary
gateway client stoppedrejection.User Impact
User impact: there is no production or user-visible behavior change. The live-text regression suite now exercises the existing browser-client handshake and request-ordering contract deterministically while preserving the two-observer stream, subscribe/unsubscribe behavior, event payloads and counts, close assertion, and real subscriber registry path.
Why This Change Was Made
The fixture now uses the existing browser handshake helper and acknowledges hello before driving subscription requests. For each subscribe or unsubscribe operation, it records the current send boundary and waits for the exact new request frame matching the method, session key, and subscription ID. It then applies that request's parameters to the real server registry, responds to the request's actual ID, and awaits settlement before continuing.
This keeps the repair inside the fixture owner. It does not add timing sleeps, change request or broadcast behavior, weaken assertions, alter timeouts, or introduce a second protocol abstraction.
Evidence
TypeError: undefined is not an object (evaluating 'params.key')in the two-observer live-text case, followed by the pending request'sgateway client stoppedrejection during teardown.1/1; the completesrc/gateway/server-broadcast.live-text.test.tsfile passed18/18.packages/gateway-client/src/protocol-client.handshake-queue.test.ts, which controls held-until-hello request ordering, passed7/7on the unchanged protocol owner input and was reused across the final fixture-only correction.