Repository navigation
fix(xai): preserve authoritative realtime response outcomes - #117186
Conversation
| }); | ||
| const server = createServer(); | ||
| const sockets = new Set<WebSocket>(); | ||
| const wss = new WebSocketServer({ noServer: true }); |
|
Codex review: needs real behavior proof before merge. Reviewed August 1, 2026, 6:27 AM ET / 10:27 UTC. ClawSweeper reviewWhat this changesThe PR updates the xAI realtime voice plugin to consume terminal response output and status, preserving final assistant transcripts, surfacing terminal failures, and delivering completed output-only tool calls once. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 3 items remain This PR remains necessary: current Priority: P2 Review scores
Verification
How this fits togetherThe xAI realtime voice plugin receives provider WebSocket events and translates them into assistant transcript callbacks, provider errors, and tool-call callbacks for a voice session. Terminal response events are the final authoritative signal that determines whether output is visible, an error is reported, or deferred tool work may run. flowchart LR
A[xAI realtime WebSocket events] --> B[xAI voice event owner]
B --> C[Terminal response status and output]
C --> D[Assistant transcript callback]
C --> E[Actionable provider error]
C --> F[Completed tool-call delivery]
D --> G[Voice session]
E --> G
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource +43, Tests +265. Total +308 across 4 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep terminal response status/output ownership in Do we have a high-confidence way to reproduce the issue? Yes—source-reproducible with high confidence: current main’s terminal response handler ignores output and failure status, while the added loopback bridge test supplies the exact missing event shapes. The review did not execute the test because this is a read-only inspection. Is this the best way to solve the issue? Yes—the PR repairs the existing xAI event owner rather than adding a parallel path, preserves the documented immediate streamed-function-call flow, and uses existing tool-call deduplication. A real provider trace remains necessary to validate the vendor contract rather than change the solution direction. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b6b440d07680. LabelsLabel 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
HistoryReview history (1 earlier review cycle)
|
What Problem This Solves
Fixes an issue where xAI realtime voice users could lose assistant transcripts present only in the terminal response, receive no actionable explanation for failed or incomplete model turns, and silently miss completed tool calls present only in supported response output.
Why This Change Was Made
The existing private xAI event owner now consumes authoritative terminal response status, provider error details, assistant output, and completed function-call output. Newly recovered output-item calls wait for a successful terminal response and deduplicate against final output. Existing streamed-argument completion and resumed conversation replay remain immediate, as required by xAI's documented function-call flow. A duplicated bridge-readiness wrapper is removed.
User Impact
Evidence
fdcb321bfaaadb5a1e7d123b6be7a934980f8b12.a02cc5c8495316bc1b05df9d24d836edbca74917.response.function_call_arguments.doneexecution: https://docs.x.ai/developers/model-capabilities/audio/speech-to-speech.