Skip to content

fix(openai): voice calls fail when starting GPT-Live from plugin scope - #189358

Merged
obviyus merged 4 commits into
openclaw:mainfrom
evaldass:fix/openai-realtime-worker-format-20261031
Oct 31, 2026
Merged

obviyus merged 4 commits into
openclaw:mainfrom
evaldass:fix/openai-realtime-worker-format-20261031

Conversation

@evaldass

@evaldass evaldass commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

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; audioFormat is therefore a Proxy, which Node cannot structured-clone into Worker.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.com to the fixture and the Gateway trusts only the task's additional CA. No GPT-Live baseUrl override, 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.

  • Main 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 exposes DataCloneError at Node worker construction.
  • Candidate runtime build 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.
  • Single-session control: the ordinary core talk.session.create / appendAudio / close path 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 483922513009c15428d4756890bbb89306c7e04a has the identical production blob dfed20dc749a6f2bb3ddb81d57b25a337e07b458 as the newly proven runtime build and accessible publication 95c03f782990a4d2c2211e9586722d0a9f6df836. 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 integration 3488f3f.

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.

@clawsweeper

clawsweeper Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 31, 2026
@clawsweeper

clawsweeper Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This 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.

  • Before: Worker construction rejects the nested invocation Proxy with DataCloneError, preventing media startup.
  • After: The worker receives a cloneable format record and exchanges 960-byte PCM frames.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A useful, narrowly scoped repair with direct Gateway transport proof and no code findings; focused validation transparently retains one unresolved pacing-test failure.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The supplied Node 24 Docker Gateway trace exercises real plugin invocation views, the shipped OpenAI plugin, default media workers, and a TLS/WebSocket fixture: baseline scoped sessions fail, candidate PCM and mu-law sessions exchange correctly formatted audio concurrently, and closing one leaves the other active; the tested production blob matches final head.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: GPT-Live calls initiated through plugin scope fail before audio starts.
Reason: The existing supported provider path receives a cloneable format without changing configuration, public APIs, defaults, or carrier behavior.

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
Reviewed head: 483922513009c15428d4756890bbb89306c7e04a

Before merge

None.

Findings

None.

Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • GPT-Live worker transfer keeps the original intent (41ee7fb: Move timing-sensitive media into a worker so Gateway event-loop stalls do not interrupt audio, while retaining admission and transcript ownership on main.)
  • Managed-proxy regression consolidation keeps the original intent (4492100: Consolidate repeated fixtures while retaining distinct owner-boundary assertions; the underlying transport cases originated in merged fix(openai): GPT-Live Talk bypasses the managed proxy on egress-restricted hosts #175886.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 012d92f adds extensions/openai/realtime-quicksilver-socket.ts:31 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 012d92f53781; files: extensions/openai/realtime-quicksilver-socket.ts)

PR surface

Source +2, Tests -4. Total -2 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 2 0 +2
Tests 1 24 28 -4
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 26 28 -2

Review metrics

Metric Value Why it matters
Production versus tests Production +2/-0; tests +24/-28 The necessary transfer snapshot adds no new abstraction, and the regression extends existing transport cases while reducing test scaffolding.

Labels

Label changes:

No label changes.

Label justifications:

  • P1: Plugin-scoped GPT-Live sessions fail during worker construction before media can connect, blocking the affected voice workflow.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-31T12:27:40.729Z sha 95c03f7 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-31T15:19:22.724Z sha 95c03f7 :: needs maintainer review before merge. :: none

Reviewed October 31, 2026, 12:20 PM ET / 16:20 UTC (Revision 3).

@evaldass

Copy link
Copy Markdown
Contributor Author

Added inspectable, redacted runtime output to the PR body: the recorded plugin-mediated session reaches session.ready, starts output audio and completes, with durable caller/assistant finals. The integration candidate and unchanged-file correspondence to this publication head are explicit; no new call was made.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 31, 2026
@obviyus

obviyus commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator

Fresh built-Gateway scoped-format proof

Main artifact: c34246e57b5e1609e584241378b1e8e1e26bdc9c (OpenClaw 2026.10.9 (c34246e)).
Candidate runtime artifact: 63bcde4cc897a8855eb1c922612c59993a90c9bf (OpenClaw 2026.10.9 (63bcde4)).
Final head: 483922513009c15428d4756890bbb89306c7e04a (subsequent changes are test-only).

All execution was in secretless Node 24.22.1 Docker. A local HTTPS/WebSocket server presents a task-owned certificate for api.openai.com; container-only DNS routing reaches it at the normal GPT-Live /v1/live/sessions URL. The Gateway/worker use the task's extra CA. No baseUrl, TLS verification bypass, real provider key, model inference or LiveKit implementation.

The driver keeps an authenticated Gateway WebSocket open. Its fixture plugin invokes the public createRealtimeVoiceSessionHarness and provider-resolution APIs inside the real plugin invocation scope, then uses the shipped OpenAI plugin and default worker. There is no manually constructed Proxy or fake Worker in this runtime proof. The normal session owner creates the invocation view.

                            plain single-session control   scoped PCM    scoped mu-law
main c34246e                ready + returned audio         startup fail  startup fail
candidate runtime 63bcde4    ready + returned audio         ready+audio   ready+audio

main scoped failures:
OpenAI GPT-Live gateway relay failed
TLS connections for scoped sessions: 0
(the independent real-worker regression reports DataCloneError at new Worker)

candidate concurrent session outputs:
PCM16, 24000 Hz, mono:      960-byte PCM frames, zero-silence prefix
G.711 mu-law, 8000 Hz mono: 155-byte streaming-filter startup prefix,
                           then 160-byte frames, mu-law silence prefix 0xff
close PCM:                 its audio count stays fixed;
                           mu-law continues with its own codec state

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, session.start / session.started, input-audio frames and returned output-audio frames.

The plain control uses the actual talk.session.create, talk.session.appendAudio and talk.session.close RPCs. Thus the observed main defect is scoped-startup serialization failure, not a fabricated claim that main mutates another call's format.

Native config/state/database preflight resolves only beneath /runtime/p189358-r2/{base,cand} with explicit profiles; no live state is used. The candidate Gateway exited normally (code 0, no forced termination).

Final-file identity

For extensions/openai/realtime-quicksilver-socket.ts:

publication 95c03f782990a4d2c2211e9586722d0a9f6df836
new runtime proof 63bcde4cc897a8855eb1c922612c59993a90c9bf
final head 483922513009c15428d4756890bbb89306c7e04a
production Git blob in each: dfed20dc749a6f2bb3ddb81d57b25a337e07b458
container source blob:      dfed20dc749a6f2bb3ddb81d57b25a337e07b458

The final test source also matches its tested container copy. The old integration 3488f3f is not accessible and is not used as source-equality or runtime evidence here.

Checks, including the local timing limitation

  • Initial five-file focused run: 32 passed.
  • Final first-audio-fixture simplification: 31 passed / 1 failed. The failure is the pre-existing “keeps actual PCM packets paced during a blocked Gateway” case, observing 8 packets versus its unchanged minimum 10. It was not weakened or repeatedly rerun to get green, and this PR does not claim a pacing fix.
  • Both scoped-format managed-worker cases pass. Main comparison has 2 DataCloneError failures / 2 controls passed; its pacing control passed.
  • Targeted formatting passes.
  • Production +2/-0; tests/support +24/-28, net -4. Run/close and managed-proxy acceptance/refusal assertions remain; duplicate standalone cases and the duplicate audio packet collection are removed.

Original @evaldass commit preserved. No carrier, auth, global admission, OAuth/config-proxy or broker-shutdown changes.

@obviyus

obviyus commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 31, 2026
@obviyus

obviyus commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator

Exact-head hosted validation

Head remains 483922513009c15428d4756890bbb89306c7e04a; no additional code push or job rerun.

  • openclaw/ci-gate passed.
  • OpenAI extension-bundle validation passed. Its Bun-backed OpenAI shard reports 55 tests passed in 6 files, including both proxy-format managed-worker cases and the unchanged blocked-Gateway pacing case (690 ms). This adds hosted coverage; it does not erase the separately disclosed local Node/Docker pacing failure or claim a pacing repair.
  • The earlier PR-context failure was caused by my nonstandard Shipped Gateway proof section title. It is now correctly headed Evidence: shipped Gateway proof, and the replacement context check passed. No source changes were needed.
  • Exact-head ClawSweeper review is 4/6, no findings; transport-proof confidence is 5/6.

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.

@obviyus
obviyus merged commit 1813428 into openclaw:main Oct 31, 2026
120 of 124 checks passed
@obviyus

obviyus commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator

Landed in 1813428. Thanks @evaldass. GPT-Live scoped Talk sessions now start with their own audio format.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 1, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: openai P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants