fix(tts): use additional_headers for websockets v15 in xAI streaming TTS - #75201
pluton74mac wants to merge 1 commit into
Conversation
websockets v15.0 renamed the connect() kwarg extra_headers → additional_headers. The xAI streaming TTS path (XAIStreamer._async_frames) was still passing extra_headers, causing every streaming synthesis call to crash with: BaseEventLoop.create_connection() got an unexpected keyword argument 'extra_headers' The crash had a cascading failure mode: audio fell back to the non-streaming POST endpoint (so responses were still audible), but the broken WebSocket lifecycle jammed the wake-word state machine into a pause/resume loop, making the mic feel stuck after the first spoken reply. Fix: rename the kwarg to match the websockets v15 API.
teknium1
left a comment
There was a problem hiding this comment.
Thanks for the focused compatibility fix. The current implementation still passes extra_headers at tools/tts_streaming.py:458, while the repository pins websockets==15.0.1 in pyproject.toml:102; the proposed additional_headers call matches the current API.
Problems
- There is no regression test for this call path.
tests/tools/test_tts_streaming.py:193-202covers only xAI credential availability; it does not exerciseXAIStreamer._async_framesor inspectwebsockets.connectarguments.
Suggested changes
- Add a hermetic mocked WebSocket test that drives
XAIStreamer._async_framesand assertsadditional_headers={"Authorization": ...}is passed toconnect.
This is an automated hermes-sweeper review.
|
|
||
| async with websockets.connect( | ||
| ws_url, extra_headers={"Authorization": f"Bearer {api_key}"} | ||
| ws_url, additional_headers={"Authorization": f"Bearer {api_key}"} |
There was a problem hiding this comment.
Please add a mocked regression test for XAIStreamer._async_frames that asserts this call passes additional_headers; the existing xAI tests only cover credential availability.
SummaryThree PRs address #73985: #75201 fixes only the websockets v15 header keyword, while #73986 rewrites the handshake and wire protocol, restores incremental streaming and failure propagation, enforces the byte cap before enqueueing, and adds loopback regressions; closed #77285 is a substantially overlapping salvage copy of that rewrite. Related pull requests
Duplicates#75201 is a narrow subset of #73986, and #77285 is a substantially overlapping salvage duplicate of #73986; #77285 is already closed. Suggested consolidationKeep #73986 open as the consolidation target, preserving its complete protocol rewrite, pre-enqueue byte-cap enforcement, failure propagation, and loopback regression suite; its diff addresses the blocking contributor feedback and it is the recorded best fix for #73985. Close #75201 as a duplicate of #73986 despite its earlier keep_open review because #73986 now includes both the same Cross-PR triage: Reviewed 3 pull requests and 1 issue in this complex. Each diff was read against this issue; Assessment working set: 36 kB of PR diffs, 19 kB of issue/PR text, 7 kB of discussion (10 comments), 3 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch. |
Verification comment (Vox Lockin lane 10 — adversarial check)Verified this PR against current
The 1-line diff (head Status note: Composition: since this is a one-line fix in |
|
Campaign #80424 collision class — XAI-TTS This PR is part of a collision class adjudicated under the Grok/xAI campaign rebaseline (2026-08-14). The canonical disposition is recorded on #80424.
Implementation of this class is blocked until Wave 0 (T00-T04) completes classification and the canonical collision/supersession table is agreed. |
Problem
websocketsv15.0 renamed theconnect()kwargextra_headers→additional_headers. The xAI streaming TTS path (XAIStreamer._async_frames) was still passingextra_headers, causing every streaming synthesis call to crash with:Cascading failure
The crash was worse than "no streaming audio":
pause → resumeloop. After the first spoken reply, the mic felt stuck and wouldn't re-arm cleanly.speak-stream synthesis failedwarnings on every TTS call.Timeline from
gui.log:Fix
One-line kwarg rename in
tools/tts_streaming.py:458:Verified against the installed websockets version:
Testing
venv/bin/python -c "from tools.tts_streaming import XAIStreamer; print('import OK')"extra_headersusage intts_streaming.py(grep confirmed)speak-stream synthesis failedwarnings and mic re-arms cleanlyNotes
tts_streaming.py— this is a one-line API-compliance fix, not a behavioral change..bakbackup file was removed from the staging area; only the one-line fix is committed.