Skip to content

fix(talk): preserve readiness during WebRTC relay startup - #144604

Closed
JamesY023 wants to merge 1 commit into
openclaw:mainfrom
JamesY023:lane/oc-relay-start
Closed

JamesY023 wants to merge 1 commit into
openclaw:mainfrom
JamesY023:lane/oc-relay-start

Conversation

@JamesY023

Copy link
Copy Markdown
Contributor

Closes #144597

What Problem This Solves

Fixes an issue where users starting a GPT-Live Gateway voice relay could miss readiness when the provider started during WebRTC negotiation. A startup that subsequently failed could also announce readiness prematurely.

Why This Change Was Made

Adopt the sideband before applying the SDP answer, reject buffered terminal events before replay, and publish readiness only after startup accepts the transport. Negotiate the provider's oai-events data channel with bundled media so its open event can supply readiness when session.started is not replayed; the sideband continues to handle provider events. The direct transport retains its existing readiness and audio behavior.

User Impact

Gateway voice relays retain early provider readiness and notify the host once after successful startup. Failed startup releases both transports without announcing readiness.

Evidence

  • Node 26.8.1, native Vitest 5: six affected bridge, direct, lifecycle, error, audio-pipeline, and peer suites passed (53 tests; existing Bun-only check skipped because Bun is not installed).
  • Reversing only the two production-file changes made seven regressions fail. Restoring the fix passed those regressions, including a real local WebRTC event-channel handshake and closure.
  • Extension test typechecking passed. Targeted lint and formatting passed.
  • Full OpenAI lane: 1,195 tests passed, one existing Bun check skipped, and one transcription client-secret test timed out under the full run. That transcription test passed in isolation with both production changes reversed.
  • Independent autoreview found no actionable P0–P2 findings. Subsequent changes added required braces in three test branches only.

These are deterministic startup and local WebRTC proofs; a live provider call was not repeated against this source change. The issue is timing-dependent, not a claim that every unmodified voice startup fails.

@clawsweeper

clawsweeper Bot commented Sep 11, 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.

@JamesY023
JamesY023 marked this pull request as ready for review September 11, 2026 02:58
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 11, 2026
@clawsweeper

clawsweeper Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

The OpenAI voice relay captures readiness before accepting the WebRTC answer, delays its readiness notification until startup succeeds, and adds an event-channel readiness fallback.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch has focused regression coverage and no identified blocking defect, but real-transport evidence covers only part of the changed behavior.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Merge readiness

⛔ Blocked before merge - 2 items remain

This PR addresses a source-supported race that remains on current main and in the latest release. Its paired bug report remains open, and no verified merged replacement solves the problem. No introduced correctness defect was found.

Priority: P2
Reviewed head: 76943842b542c6e42b541730efa361fdf7ffb43d

Before merge

  • Add real behavior proof - The captured body reports a real local handshake through the production WebRTC peer, but the changed Gateway bridge's early-readiness and failed-start scenarios use synthetic peers and sockets. The prior request remains: provide a redacted after-fix production-bridge trace with real transport clients showing one readiness notification after acceptance, none on failed startup, and cleanup of both transports. Terminal output or logs are suitable; redact credentials, addresses, phone numbers, private endpoints, and other private data. Update the PR body to trigger re-review, or ask a maintainer to comment @clawsweeper re-review. No stored-data contract changes.
  • Complete next step - Resolve the current-main conflicts and add after-fix real-transport proof through the production bridge for single readiness, failed-start suppression, and cleanup.

Findings

None.

Agent review details

How this fits together

The Gateway voice relay connects Talk audio clients to OpenAI through WebRTC media and a separate provider-event socket. Its readiness notification tells the host when the voice session can proceed.

flowchart TD
  A[Talk audio client] --> B[Gateway voice relay]
  B --> C[WebRTC media negotiation]
  B --> D[Provider event socket]
  C --> E[Startup and readiness gate]
  D --> E
  E --> F[Host readiness notification]
  C --> G[Voice audio exchange]
Loading

Technical review

Best possible solution:

Keep startup readiness in the existing relay owner, preserving early provider signals while notifying the host once only after successful transport acceptance.

Do we have a high-confidence way to reproduce the issue?

Yes, source establishes the ordering mechanism: current main opens the sideband after applying the answer, allowing an early provider readiness event to precede its listener. The contributor reports failing regressions; this read-only review did not execute them.

Is this the best way to solve the issue?

Yes, the proposed ownership and readiness gate address the race narrowly. The current-main version must carry the event-channel signal through the media worker boundary and retain direct-transport behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against d8f523822def.

Security

None.

Evidence

What I checked:

PR surface

Source +26, Tests +138. Total +164 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 36 10 +26
Tests 2 142 4 +138
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 178 14 +164

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #144597
Summary: This PR is the explicit candidate fix for the paired readiness-race report; admission validation and direct-browser startup latency are separate concerns.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded voice-relay startup race with a clear source mechanism and focused regression coverage.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add the requested production-bridge trace for successful readiness, failed startup, and transport cleanup.
  • Resolve conflicts against current main and preserve the readiness signal across its media worker boundary.

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-09-11T03:05:58.520Z sha 7694384 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-23T14:59:12.045Z sha 7694384 :: needs real behavior proof before merge. :: none

Reviewed October 4, 2026, 11:33 PM ET / October 5, 2026, 03:33 UTC (Revision 3).

@roboclaw-bot

Copy link
Copy Markdown
Collaborator

Thanks @JamesY023 for the clear reproduction and startup-readiness fix. Landed the focused replacement in #190466 (#190466), preserving your co-author credit. The separate data-channel fallback proposal remains tracked in #144597.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: openai P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Talk relay can lose readiness while accepting the WebRTC answer

2 participants