Repository navigation
fix(openai): voice calls fail when starting GPT-Live from plugin scope - #189358
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 copies the plugin-scoped audio format into a plain record before transferring it to the GPT-Live media worker. Example: A plugin starts GPT-Live with mono PCM16 audio at 24000 Hz.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR fixes a concrete GPT-Live startup failure at the existing worker boundary, with no actionable code findings. Priority: P1 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe OpenAI plugin's socket adapter transfers connection and audio-format settings from the Gateway into a media worker, which owns WebSocket audio transport and codec processing. flowchart LR
A[Plugin invocation] --> B[Talk session owner]
B --> C[OpenAI voice bridge]
C --> D[Worker transfer adapter]
D --> E[Media worker]
E --> F[GPT Live WebSocket]
Technical reviewBest possible solution: Retain the narrow audio-format snapshot in the existing worker adapter and the consolidated real-worker regressions. Do we have a high-confidence way to reproduce the issue? Source confirms the nested invocation-view transfer path, and submitted baseline Gateway output plus real-worker DataCloneError regressions establish the failure; this read-only review ran no target code. Is this the best way to solve the issue? The patch is the smallest complete repair: copy the primitive format record at its serialization boundary while preserving invocation callbacks, worker ownership, proxy routing, and codec selection. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 52a0e531a966. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +2, Tests -4. Total -2 across 2 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes: No label 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 HistoryReviewed October 31, 2026, 12:20 PM ET / 16:20 UTC (Revision 3). |
|
Added inspectable, redacted runtime output to the PR body: the recorded plugin-mediated session reaches @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Fresh built-Gateway scoped-format proofMain artifact: All execution was in secretless Node 24.22.1 Docker. A local HTTPS/WebSocket server presents a task-owned certificate for The driver keeps an authenticated Gateway WebSocket open. Its fixture plugin invokes the public The 155-byte first mu-law chunk is the existing streaming resampler's retained filter tail, not a new pacing/codec change. The fixture verifies its steady 160-byte output without incorrectly requiring every startup chunk to be full-sized. Every successful socket uses real TLS, The plain control uses the actual Native config/state/database preflight resolves only beneath Final-file identityFor The final test source also matches its tested container copy. The old integration Checks, including the local timing limitation
Original @evaldass commit preserved. No carrier, auth, global admission, OAuth/config-proxy or broker-shutdown changes. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Exact-head hosted validationHead remains
Three earlier automation jobs were cancelled (two auto-response, one context); no product-test shard was cancelled. The prior failed context check is historical and superseded by its successful replacement. |
openclaw#189358) fix(openai): snapshot the proxied audio format before handing it to the realtime worker GPT-Live Talk sessions passed a proxied audio-format object to the realtime worker instead of a plain copy. A proxy can't be cloned across threads, so scoped sessions failed before their worker sockets opened. The audio format is now copied before the transfer. Each session keeps its own format, and closing one session doesn't affect another. Evidence: built Gateway over TLS WebSocket to a local GPT-Live fixture, with no baseUrl, real keys or inference. Main failed both scoped sessions before their worker sockets opened (2 of 2). With this change PCM 24 kHz and μ-law 8 kHz sessions both started, exchanged correctly formatted audio at the same time, and closing the PCM session left μ-law working. An ordinary single-session Talk control worked on both refs. Details: openclaw#189358 (comment). Thanks @evaldass. Co-authored-by: Ayaan Zaidi <[email protected]>
Related: #170000
What problem this solves
GPT-Live calls started from a plugin invocation fail at media-worker construction. The session owner wraps nested bridge inputs in invocation views;
audioFormatis therefore a Proxy, which Node cannot structured-clone intoWorker.workerData. Copying only the outer media options does not remove that nested proxy.Change
Snapshot the existing format record at the media-worker transfer boundary. Preserve the encoding, sample rate, channels, invocation/callback ownership and default worker implementation. No configuration, SDK, authentication, carrier, pacing or shutdown changes.
Original fix by @evaldass; the contributor commit is preserved. The duplicate standalone proxy tests are folded into the existing real-worker managed-proxy cases, retaining admission/refusal, audio and close assertions. First-audio observation now uses its existing promise instead of a duplicate packet collection. Production +2/-0; tests/support +24/-28 (net -4) against merge base
159d00bed3fb5be9bab9f3e9a546ee6714ee20b2.Evidence: shipped Gateway proof
Fresh runtime captures and final-file identity: #189358 (comment)
Fresh Node 24.22.1 Docker builds, authenticated Gateway WebSocket RPCs, the shipped OpenAI plugin and its default real media workers, with a local GPT-Live TLS/WebSocket endpoint. Container-only DNS maps
api.openai.comto the fixture and the Gateway trusts only the task's additional CA. No GPT-LivebaseUrloverride, real provider credentials, LiveKit feature or model inference.The fixture calls the public Talk session harness/provider APIs from an actual Gateway plugin invocation; it does not manually construct a Proxy or replace
Worker. This exercises the production invocation-view producer and transfer boundary.c34246e57b5e1609e584241378b1e8e1e26bdc9c: two scoped sessions (PCM16/24 kHz and G.711 mu-law/8 kHz) fail before opening their TLS worker sockets. The real-worker regression separately exposesDataCloneErrorat Node worker construction.63bcde4cc897a8855eb1c922612c59993a90c9bf: both scoped sessions reach readiness and exchange audio concurrently. PCM receives 960-byte frames; mu-law receives its legitimate 155-byte resampler startup prefix followed by 160-byte frames. Closing PCM leaves the mu-law session receiving correctly formatted audio, with no later PCM delivery.talk.session.create/appendAudio/closepath reaches readiness and returns audio on both main and candidate. The observed main defect is startup serialization failure, not a claimed cross-call mutation.Final source provenance: final head
483922513009c15428d4756890bbb89306c7e04ahas the identical production blobdfed20dc749a6f2bb3ddb81d57b25a337e07b458as the newly proven runtime build and accessible publication95c03f782990a4d2c2211e9586722d0a9f6df836. Subsequent changes are test-only. The final production/test source files also match their container copies. No equality claim or proof dependency is made for inaccessible integration3488f3f.Focused checks and limits
Five focused suites initially passed 32/32. The final simplified fixture run reports 31 passed / 1 failed: the existing blocked-Gateway pacing case observed 8 packets against its unchanged minimum of 10. Both proxy-format regression cases pass; baseline comparison reports 2 DataCloneError failures / 2 controls passed. No timing threshold was weakened and no pacing fix is claimed. Formatting passes; exact-head hosted CI provides the broader verdict.
This is audio transport/format proof using synthetic PCM and mu-law, not speech recognition, audible conversation, inference, LiveKit acceptance or a shutdown repair.
Merge danger
Two-way door: reverting restores the prior transfer shape. No persistent data/schema/config change. Blast radius is GPT-Live worker audio-format initialization; a wrong snapshot could reject scoped calls or select the wrong codec. Concurrent codec isolation and the plain single-session control cover those boundaries.