Skip to content

Conversation

@simllll
Copy link

@simllll simllll commented Oct 24, 2025

Description

this helps finding the issue when elevenlabs is just silent and nothing is happening (e.g. out of credit or invalid voice)

Changes Made

  1. added check for ".error"
  2. throw error and not just ignore it (not sure why this was initially like this?)

Pre-Review Checklist

  • Build passes: All builds (lint, typecheck, tests) pass locally
  • AI-generated code reviewed: Removed unnecessary comments and ensured code quality
  • Changes explained: All changes are properly documented and justified above
  • Scope appropriate: All changes relate to the PR title, or explanations provided for why they're included

Testing

  • Automated tests added/updated (if applicable)
  • All tests pass
  • Make sure both restaurant_agent.ts and realtime_agent.ts work properly (for major changes)

Additional Notes


Note to reviewers: Please ensure the pre-review checklist is completed before starting your review.

this helps finding the issue when elevenlabs is just silent and nothing is happening (e.g. out of credit or invalid voice)
@changeset-bot
Copy link

changeset-bot bot commented Oct 24, 2025

🦋 Changeset detected

Latest commit: a832731

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

This PR includes changesets to release 1 package
Name Type
@livekit/agents-plugin-elevenlabs 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

@simllll simllll marked this pull request as ready for review October 24, 2025 14:54
@simllll simllll changed the title check if json.error exists and throws error elevenlabs check if json.error exists and throws error Oct 24, 2025
// skip log error for normal websocket close
if (err instanceof Error && !err.message.includes('WebSocket closed')) {
this.#logger.error({ err }, 'Error in listenTask from ElevenLabs WebSocket');
throw err;
Copy link
Author

Choose a reason for hiding this comment

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

we could throw only on ElevenLabsError, but I can't see a reason why other errors should be "silently ignored"?

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.

1 participant