Skip to content

xAI STT plugin#1260

Merged
toubatbrian merged 4 commits intomainfrom
brian/xai-stt
Apr 15, 2026
Merged

xAI STT plugin#1260
toubatbrian merged 4 commits intomainfrom
brian/xai-stt

Conversation

@toubatbrian
Copy link
Copy Markdown
Contributor

No description provided.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 15, 2026

🦋 Changeset detected

Latest commit: 32d5a2b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 25 packages
Name Type
@livekit/agents-plugin-cartesia Patch
@livekit/agents-plugin-openai Patch
@livekit/agents-plugin-xai Patch
@livekit/agents-plugin-anam Patch
@livekit/agents-plugin-cerebras Patch
@livekit/agents-plugin-deepgram Patch
@livekit/agents-plugin-elevenlabs Patch
@livekit/agents-plugin-google Patch
@livekit/agents-plugin-inworld Patch
@livekit/agents-plugin-neuphonic Patch
@livekit/agents-plugin-resemble Patch
@livekit/agents-plugin-rime Patch
@livekit/agents-plugin-sarvam Patch
@livekit/agents Patch
@livekit/agents-plugin-assemblyai Patch
@livekit/agents-plugin-baseten Patch
@livekit/agents-plugin-bey Patch
@livekit/agents-plugin-hedra Patch
@livekit/agents-plugin-lemonslice Patch
@livekit/agents-plugin-livekit Patch
@livekit/agents-plugin-mistral Patch
@livekit/agents-plugin-phonic Patch
@livekit/agents-plugin-silero Patch
@livekit/agents-plugin-trugen Patch
@livekit/agents-plugins-test Patch

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

chatgpt-codex-connector[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

toubatbrian and others added 2 commits April 15, 2026 14:56
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@toubatbrian toubatbrian merged commit eb18539 into main Apr 15, 2026
7 of 8 checks passed
@toubatbrian toubatbrian deleted the brian/xai-stt branch April 15, 2026 22:02
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

View 10 additional findings in Devin Review.

Open in Devin Review

Comment thread plugins/xai/src/stt.ts

await Promise.race([
this.#resetWS.await,
Promise.all([sendTask(), listenTask.result, wsMonitor]),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Suggested change
Promise.all([sendTask(), listenTask.result, wsMonitor]),
Promise.all([sendTask(), listenTask.result, wsMonitor.result]),
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@github-actions github-actions Bot mentioned this pull request Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants