Repository navigation
fix(realtime): add timeout to WebRTC offer requests - #104662
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 12, 2026, 2:32 PM ET / 18:32 UTC. Summary PR surface: Source +64, Tests +93. Total +157 across 2 files. Reproducibility: yes. Current main can be reproduced by returning successful SDP response headers while leaving Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Keep the deadline transport-local and internal, spanning fetch and body consumption, while preserving stop as silent cancellation and proving both lifecycle outcomes on the exact current head. Do we have a high-confidence way to reproduce the issue? Yes. Current main can be reproduced by returning successful SDP response headers while leaving Is this the best way to solve the issue? Yes. A transport-owned AbortController spanning fetch and body consumption is the narrowest maintainable fix and avoids a global timeout, retry layer, or new configuration surface. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e0aba31727d6. Label changesLabel justifications:
Evidence reviewedPR surface: Source +64, Tests +93. Total +157 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (6 earlier review cycles)
|
|
@clawsweeper re-review Updated the PR body with exact-head browser proof at New proof ran Playwright Chromium against a Vite-served Control UI module harness and same-origin stalled SDP endpoint. It exercises Observed result: the browser sent the SDP This remains local browser proof, not live OpenAI Realtime proof. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
f0d91da to
55f9f2b
Compare
55f9f2b to
222677b
Compare
|
Maintainer refactor and land-ready proof complete on What changed:
Proof:
The fix is transport-local, adds no config surface, and matches the stop-during-start contract used by sibling Talk transports. Thanks @Alix-007 for the original fix and browser stalled-body reproduction. |
|
Merged via squash.
|
* fix(realtime): add timeout to WebRTC offer requests * test(realtime): reject offer aborts with errors * fix(ui): abort pending realtime offer on stop * test(ui): normalize realtime abort rejection --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Realtime WebRTC voice setup could remain stuck forever if the SDP offer endpoint returned headers but never completed the answer body. Stopping Talk during that stall also left the request and its deadline alive until the timeout fired.
Why This Change Was Made
The WebRTC transport now owns one pending offer request across both
fetch()and response-body consumption. A 30-second deadline aborts a genuinely stalled exchange, whilestop()clears that deadline and aborts the same request immediately. Identity-guarded cleanup prevents an older request from detaching a replacement request, and the timeout constant remains private instead of becoming a test-only production export.This keeps cancellation at the transport that already owns the peer, microphone, media element, and stop lifecycle; it adds no configuration or cross-session policy.
User Impact
Evidence
Prepared head:
222677b2c30bbfae7f36860c2a141a4ebce6bb03tbx_01kxbr8kw8ywrht8vmmh244r1q:pnpm test ui/src/pages/chat/realtime-talk-webrtc.test.tspassed 21/21; targetedoxfmt --checkandoxlintpassed.gpt-realtime-2.1: backend Realtime bridge connected; browser WebRTC received an SDP answer containing audio, applied the remote description, and reachedconnected.AI-assisted change.