Repository navigation
fix(xai): preserve transcription audio on reopen - #130297
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 2:53 PM ET / 18:53 UTC. ClawSweeper reviewWhat this changesThe PR starts xAI transcription reconnection before flushing queued audio so audio queued during a reopen reaches the new WebSocket session. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open: current main still drains xAI transcription audio into a closed provider session before reopening it, while this focused patch reverses that sequence and adds a credible regression test. It is a protected maintainer PR, so normal human approval and exact-head CI remain required. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — step 1 Assertions:
How this fits togetherxAI’s realtime transcription wrapper buffers microphone audio while its provider session loads or reconnects. It delegates the actual socket lifecycle to the shared realtime-transcription session, which queues audio until the provider reports readiness. flowchart LR
A[Audio input] --> B[Lazy xAI wrapper]
B --> C[Wrapper audio queue]
B --> D[Start reconnect]
C --> E[Shared WebSocket session]
D --> E
E --> F[xAI transcription service]
Decision needed
Why: The protected maintainer label requires explicit human handling even though the source review found no correctness blocker. Before merge
Agent review detailsSecurityNone. PR surfaceSource -1, Tests +38. Total +37 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Land the provider-local ordering repair after exact-head CI and the required maintainer review; retain the bounded queue and close-generation behavior unchanged. Do we have a high-confidence way to reproduce the issue? Yes, from source: close a lazy xAI transcription session, queue audio while reopening, and the current-main wrapper forwards it before the underlying session’s synchronous reopen begins. Is this the best way to solve the issue? Yes. Starting the existing provider session before draining the wrapper’s retained queue uses the shared session’s established readiness queue instead of adding a parallel recovery path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 08a42a561c8f. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
Fixes an issue where audio queued while reopening an xAI realtime transcription session could be silently dropped after the previous underlying WebSocket session had closed.
Why This Change Was Made
The lazy provider now begins the underlying reconnect before draining queued audio. The session's synchronous connect prefix reopens input acceptance, so queued chunks are delivered in order to the new generation instead of being sent into the still-closed session. Existing close, ordering, and concurrent-open behavior remains unchanged.
User Impact
Users reopening realtime transcription no longer lose the first queued audio chunks during reconnect.
Evidence