Repository navigation
feat(openai): support custom realtime voice endpoints - #165632
Conversation
Allow one provider-owned baseUrl for Gateway-relayed Realtime WebSockets while preserving default OpenAI and Azure routing. Keep keys server-side and reject incompatible browser/GPT-Live routes. Related: #114146 Co-authored-by: jacobtomlinson <[email protected]>
|
🦞👀 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. |
The userinfo rejection test needs only a username. Remove its unnecessary synthetic password after the hosted input scanner identified the literal; do not change scanner policy or the runtime guard. Co-authored-by: jacobtomlinson <[email protected]>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed October 5, 2026, 11:33 AM ET / 15:33 UTC (Revision 2). ClawSweeper reviewWhat this changesThe OpenAI plugin adds a custom realtime WebSocket endpoint setting for Gateway-side voice connections, with URL validation, transport restrictions, documentation, and regression coverage. Merge readiness✅ Ready for maintainer review This PR remains useful: current main and the latest release still lack the custom realtime endpoint setting. No concrete introduced correctness or security defect was found. Priority: P2 Review scores
Verification
How this fits togetherTalk and backend voice consumers pass provider settings to the OpenAI realtime voice plugin. The plugin selects authentication and transport, opens the voice connection, and exchanges audio and session events. flowchart TD
A[Talk and backend voice settings] --> B[OpenAI voice provider]
B --> C[Validate endpoint and transport]
C --> D[Reject incompatible combinations]
C --> E[Gateway WebSocket bridge]
F[Server-side API key] --> E
E --> G[Configured realtime server]
G --> H[Audio and session events]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +61, Tests +133, Docs +46. Total +240 across 8 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep endpoint selection and validation in the existing OpenAI Gateway bridge, preserve default routes, and leave vendor-specific protocol support to provider plugins. Do we have a high-confidence way to reproduce the issue? Not applicable as a defect reproduction: this adds a capability. Current-main source confirms the existing bridge lacks the requested custom endpoint setting. Is this the best way to solve the issue? Yes: extending the existing provider-owned WebSocket route is focused, and rejecting incompatible browser and GPT-Live paths preserves their credential and protocol contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against fb84dd57fd57. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
* feat(openai): support custom realtime voice endpoints Allow one provider-owned baseUrl for Gateway-relayed Realtime WebSockets while preserving default OpenAI and Azure routing. Keep keys server-side and reject incompatible browser/GPT-Live routes. Related: openclaw#114146 Co-authored-by: jacobtomlinson <[email protected]> * test(openai): avoid a password-shaped URL fixture The userinfo rejection test needs only a username. Remove its unnecessary synthetic password after the hosted input scanner identified the literal; do not change scanner policy or the runtime guard. Co-authored-by: jacobtomlinson <[email protected]> --------- Co-authored-by: jacobtomlinson <[email protected]>
Related: #114146. Consolidated reports: #164054, #164338, #164339, #164055.
What Problem This Solves
OpenAI-compatible realtime voice servers cannot be selected because the OpenAI voice bridge always connects to OpenAI's endpoint.
User Impact
Users can set
talk.realtime.providers.openai.baseUrlto a full realtime WebSocket URL and usetransport: "gateway-relay". The same provider option works for Gateway-side Voice Call and other backend voice bridges. Existing OpenAI and Azure configurations are unchanged.This adds exactly one configuration option, explicitly approved by @jacobtomlinson. The override is for the GA Realtime protocol, not GPT-Live or browser WebRTC. Mixed Azure routing and unsupported transport/model combinations fail before provider I/O rather than silently sending a custom key to OpenAI. It does not register a DashScope provider or guarantee that a third-party service supports OpenClaw's events, audio formats, voices, and tools.
Why This Change Was Made
The OpenAI provider owns URL normalization and preserves the parsed endpoint path and existing non-model query encoding. Standard URL parsing applies to raw unescaped characters. HTTP(S) aliases become WS(S), and the selected model replaces only the model query parameter. The existing direct server-side API-key flow needs no client-secret minting or additional auth toggle. URL userinfo, fragments, invalid schemes, and ambiguous Azure combinations are rejected without echoing the URL.
Requested by @jacobtomlinson; thanks to @starship863 and @wangyan411303 for the reports.
Work sessions
Evidence
06131c40d09f3249b5ac253c414aa861be1de82bthrough the provider's real creation/configuration entry points.--maxWorkers=1. After the query-encoding correction, all 34 bridge tests passed again in 8.22 s (9.51 s including wrapper).pnpm tsgo:extensionsandpnpm tsgo:extensions:testpassed. Type-aware Oxc lint on all seven changed TypeScript files passed, as did coercion-helper, deprecated-API, import-cycle (zero cycles), andgit diff --checkguards.node scripts/check-docs-config-examples.mjspassed: 1,305 configuration examples validated, including the new example.check:changedstops at three inherited mock-export failures in unchangedsrc/agents/auth-profiles/usage.test.tsandsrc/agents/bash-tools.exec-host-node.integration.test.ts. The exact failures reproduce withcheck-test-mock-exports.mts --staged --base HEADon the untouched base index; no baseline suppression was changed.Independent AutoReview (P0–P2): repaired query reserialization that changed existing
%20/~encoding and added regression coverage. The remaining apostrophe-encoding suggestion was rejected after inspectingws8.21.3: its own constructor appliesnew URL(address)and sendsparsedUrl.pathname + parsedUrl.search(lib/websocket.js:700–715,767), so raw apostrophes must be URL-encoded by the caller. The docs clarify this contract; no raw-request-target bypass was added.