fix(openai): bound realtime voice websocket payload at 16 MiB#99450
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 5, 2026, 6:59 PM ET / 22:59 UTC. Summary PR surface: Source +2, Tests +3. Total +5 across 2 files. Reproducibility: yes. source-level: current main constructs the OpenAI realtime voice backend WebSocket without maxPayload, and ws 8.21.0 defaults that client option to 100 MiB. The PR body provides after-fix loopback output showing the configured 16 MiB cap rejects an oversized frame with status 1009. 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:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Merge the provider-owned cap only after the OpenAI realtime voice owner accepts 16 MiB as the intended fail-closed ceiling, or tune that constant from representative vendor-frame evidence. Do we have a high-confidence way to reproduce the issue? Yes, source-level: current main constructs the OpenAI realtime voice backend WebSocket without maxPayload, and ws 8.21.0 defaults that client option to 100 MiB. The PR body provides after-fix loopback output showing the configured 16 MiB cap rejects an oversized frame with status 1009. Is this the best way to solve the issue? Yes for implementation shape if the threshold is accepted: owner-local WebSocket options use the dependency's built-in enforcement and avoid new config surface. The open question remains whether 16 MiB is the intended maintained cap for legitimate realtime voice frames. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a905eb42acda. Label changesLabel justifications:
Evidence reviewedPR surface: Source +2, Tests +3. Total +5 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 (1 earlier review cycle)
|
2278347 to
a508cc1
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
a508cc1 to
0befe00
Compare
0befe00 to
ec15183
Compare
|
Maintainer pass complete. I kept the contributor's boundary fix, added the missing constructor-level regression assertion, rebased it onto current Exact-head proof for
The final shape uses one named 16 MiB limit for both native OpenAI and Azure realtime sockets, with existing proxy/header behavior unchanged. Ready to land. |
|
Merged via squash.
|
…aw#99450) * fix(openai): bound realtime voice websocket payload at 16 MiB * test(openai): cover realtime voice payload cap --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Fixes an issue where the OpenAI realtime voice backend WebSocket could accept inbound frames up to the
wsdependency default of 100 MiB when the provider path did not set an explicit payload cap.Why This Change Was Made
The OpenAI realtime voice bridge now passes
maxPayload: 16 * 1024 * 1024to its backend WebSocket constructor. This is an intentional hardening cap for the provider relay path; frames above 16 MiB fail closed with WebSocket close status 1009.User Impact
Gateway voice sessions have a bounded inbound WebSocket frame size instead of inheriting the larger dependency default.
Evidence
node --import tsx outputs/pr-99450/verify-openai-voice-ws-max-payload.mjs: loopback proof throughbuildOpenAIRealtimeVoiceProvider().createBridge()and the realtime voice WebSocket constructor.AI-assisted: built with Codex