Repository navigation
fix: realtime phone calls use the wrong audio format and stay open - #133018
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 29, 2026, 11:01 PM ET / August 30, 2026, 03:01 UTC. ClawSweeper reviewWhat this changesThe PR passes carrier μ-law audio format into the GPT-Live bridge, treats a normal provider close as completion, and rejects a bridge that closes before it can be adopted. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readinessKeep this current maintainer PR open: source review finds the earlier synchronous-creation blocker addressed and current main still has the pre-fix behavior, but exact-head CI is incomplete and the required upstream Codex protocol source was unavailable in this read-only environment. Priority: P1 Review scores
Verification
How this fits togetherVoice Call receives Twilio or Telnyx media and creates a realtime provider bridge; it owns the carrier socket, call termination, and call-history outcome. Provider callbacks must preserve an existing call during replacement while ending the carrier call when an adopted provider session finishes. flowchart LR
Carrier[Carrier media stream] --> Handler[Voice Call handler]
Handler --> Format[Carrier audio contract]
Format --> Bridge[Realtime provider bridge]
Bridge --> Decision{Bridge lifecycle event}
Decision --> Adopted[Adopted session ends]
Decision --> Provisional[Candidate ends before adoption]
Adopted --> CarrierEnd[End carrier call and record outcome]
Provisional --> Preserve[Dispose candidate and preserve predecessor]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +16, Tests +82, Docs +11. Total +109 across 7 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the owner-level provisional-admission state, then merge only after exact-head CI and a maintainer-capable upstream Codex contract check confirm the documented GPT-Live behavior. Do we have a high-confidence way to reproduce the issue? Yes. The focused carrier WebSocket handler tests can inspect the bridge request and inject provider completion before or after bridge adoption; the code path is directly traceable, although this review did not execute tests. Is this the best way to solve the issue? Unclear. The owner-boundary repair and prior-finding coverage are coherent, but direct inspection of the cited Codex protocol contract was unavailable in this environment. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d4ad866e5f9c. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Addressed the P1 synchronous-creation finding in 4dd71b4. The handler records early provider termination and rejects that candidate before connecting or adopting it. Creation exceptions and terminal candidates now share cleanup; transcript ownership rolls back before disposal, and a disposal exception cannot skip carrier cleanup or retire a working predecessor. The new regressions failed in five cases before the repair. All 65 phone handler, lifecycle, and runtime-routing tests now pass, including completed/error startup, replacement preservation, disposal-time callbacks and exceptions, late transcripts, local disconnect grace, and explicit end-call. Type-aware lint and a fresh independent P0–P2 review of the complete phone PR also passed. The protocol-review limitation is covered by direct maintainer inspection of the sibling public Codex checkout at 63d213884daea50e4f74efc192cdc44f549b67d5: PCM parsing and normal close handling. The live GPT-Live entitlement/credential limitation remains explicitly documented; no live carrier call is claimed. Final exact-head CI is still required before landing. |
|
Final merge-gate follow-through for 4dd71b4: exact-head CI completed successfully; the PR rollup has 181 completed checks and no pending or failed checks. The fresh review has no actionable code finding. Both rank-up moves are covered: CI is green, and I directly inspected the required sibling Codex checkout at 63d213884daea50e4f74efc192cdc44f549b67d5, including frameless audio parsing and normal-versus-abnormal closure. The +16 production-line delta stays in the phone lifecycle owner and OpenAI transport, with duplicate startup cleanup consolidated; shared core reconnection behavior is unchanged. Live GPT-Live/carrier proof remains infeasible with the tested account entitlement and expired hydrated OAuth token, as disclosed in the PR. The observed GA sibling proof and failing-before/passing-after carrier harness regressions are not presented as a successful GPT-Live carrier call. |
|
Merged via squash.
|
…penclaw#133018) * fix: realtime phone calls use the wrong audio format and stay open * test(voice-call): observe provider completion and server cleanup * fix(voice-call): reject terminal bridges before call adoption
Closes #132992
What Problem This Solves
Fixes an issue where realtime phone audio could be decoded with the wrong format when using GPT-Live, and where a provider ending its session could leave a silent carrier call open. A provider closing during bridge creation could also be connected again or replace a working predecessor.
Why This Change Was Made
The phone media owner now supplies its existing G.711 μ-law/8 kHz/mono contract explicitly. Normal WebSocket closure is distinguished from failure, and provider-ended calls use the existing carrier termination path. The handler records a terminal callback received during creation and rejects that candidate before connecting it or adopting its bridge and transcript state. Constructor failure and terminal creation share cleanup; transcript ownership is rolled back before disposing the rejected candidate, including when disposal emits final callbacks or throws.
User Impact
Twilio and Telnyx use the correct audio format. Finished provider sessions end their carrier call, including during startup. Failed replacements leave the working call and transcript intact. Local caller teardown, explicit end-call control, and stale transport callbacks retain their ownership rules. No configuration, schema, dependency, or wire-protocol change is required. Current native GPT-Live function-tool limitations are documented.
Evidence
tbx_01m185h6k7s0dnt939ehb0dtcg: https://github.com/openclaw/openclaw/actions/runs/33286432360 . These are GA sibling proofs, not GPT-Live or carrier-call claims.63d213884daea50e4f74efc192cdc44f549b67d5,codex-rs/codex-api/src/endpoint/realtime_websocket/protocol_frameless_bidi.rs:38(PCM audio) andmethods.rs:548(normal versus abnormal close).CI follow-through: the first hosted run exposed an outdated routing expectation for provider completion and an assertion assuming client socket close implied server bridge disposal. Tests now verify distinct provider/caller end reasons in carrier calls and durable history, and wait for actual server disposal. ClawSweeper's synchronous-creation finding is addressed by the final admission repair and its failing/passing regressions.
Provenance: original failures reproduced at
9d8bf3525072487320da72b6718ecf9c69dc3f4e; exact introducing commit is not established. Shared core bridge reconnection semantics remain unchanged.AI-assisted implementation and verification. Release-note context: correct realtime phone codecs, close carrier calls when their provider ends, and preserve live calls when a replacement fails during creation.