Conversation
🦋 Changeset detectedLatest commit: 7fa80a8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 28 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 |
| try { | ||
| this.#processStreamEvent(parseStreamEvent(JSON.parse(msg.toString()))); | ||
| } catch (error) { | ||
| this.#logger.error({ error }, 'failed to process ElevenLabs STT message'); | ||
| } |
There was a problem hiding this comment.
🔴 API errors from #processStreamEvent are silently swallowed by the onMessage catch block
When the ElevenLabs server sends an error message (e.g., auth_error, quota_exceeded, transcriber_error), #processStreamEvent deliberately throws an APIConnectionError at plugins/elevenlabs/src/stt.ts:840. However, this throw occurs inside the onMessage callback, which is wrapped in a generic try-catch at lines 610-614 that only logs the error and does not call reject(). As a result, the receiveMessages promise never rejects for API errors, and the stream continues running silently. Critical conditions like authentication failures, quota exceeded, and transcriber errors are permanently lost — the caller never learns the stream has failed, and no transcriptions will be produced.
| try { | |
| this.#processStreamEvent(parseStreamEvent(JSON.parse(msg.toString()))); | |
| } catch (error) { | |
| this.#logger.error({ error }, 'failed to process ElevenLabs STT message'); | |
| } | |
| try { | |
| this.#processStreamEvent(parseStreamEvent(JSON.parse(msg.toString()))); | |
| } catch (error) { | |
| if (error instanceof APIConnectionError) { | |
| reject(error); | |
| } else { | |
| this.#logger.error({ error }, 'failed to process ElevenLabs STT message'); | |
| } | |
| } |
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
same in plugins/deepgram/src/stt_v2.ts: we throw on server Error messages but the on('message') handler catches and only logs.
py has the same shape (caught here) — carried over from the port.
| }; | ||
| } | ||
|
|
||
| // Ref: python livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/stt.py - 277-295 lines |
There was a problem hiding this comment.
Do you think we should keep those ref?
Summary
recognize()and realtime WebSocketstream()support.updateOptions({ serverVad })regression coverage.Tests
pnpm test plugins/elevenlabs/src/stt.test.tspnpm test plugins/elevenlabs/src/tts.test.tspnpm --filter @livekit/agents-plugin-elevenlabs buildpnpm --filter @livekit/agents-plugin-elevenlabs lintpnpm format:checkgit diff --checkNotes
pnpm --filter @livekit/agents-plugin-elevenlabs api:checkfails because this package has no checked-in API report folder/file yet; API Extractor also reports existing missing release-tag warnings.pnpm --filter livekit-agents-examples buildfails on missing declaration files for many unbuilt plugin packages; after fixing this example'sAgentSessionoptions, no ElevenLabs-specific example error remained.