xAI STT plugin#1260
Conversation
🦋 Changeset detectedLatest commit: 32d5a2b The changes in this PR will be included in the next version bump. This PR includes changesets to release 25 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
|
||
| await Promise.race([ | ||
| this.#resetWS.await, | ||
| Promise.all([sendTask(), listenTask.result, wsMonitor]), |
There was a problem hiding this comment.
🟡 wsMonitor Task passed directly to Promise.all instead of wsMonitor.result, making the WebSocket close monitor a no-op
The wsMonitor variable is a Task instance, which does not implement then() / PromiseLike. When passed directly to Promise.all, it is treated as an already-resolved non-thenable value (confirmed empirically: Promise.all([p, task]) resolves the task slot immediately with the Task object). This means unexpected WebSocket closures detected by wsMonitor never propagate through the promise chain — the monitor is effectively dead code.
Other STT plugins in this repo correctly use wsMonitor.result (which returns the underlying Promise): see plugins/assemblyai/src/stt.ts:432 and plugins/sarvam/src/stt.ts:760. The xAI code copied the incorrect pattern from plugins/deepgram/src/stt.ts:427.
The practical impact is that if the WebSocket closes unexpectedly, reconnection is delayed until sendTask happens to call ws.send() and gets an error, rather than reacting immediately to the close event.
| Promise.all([sendTask(), listenTask.result, wsMonitor]), | |
| Promise.all([sendTask(), listenTask.result, wsMonitor.result]), |
Was this helpful? React with 👍 or 👎 to provide feedback.
No description provided.