Skip to content

Conversation

@simllll
Copy link
Contributor

@simllll simllll commented Nov 19, 2025

Description

adds close hooks for tts,sst and vad.
also fixes the deepgram STT implementation, the additional aborthandler in this case is a safety net (e.g. when resetWS was called).
This change is required for #837 (TTS), but also for #829 (STT) to cleanup the websocket on session end.
also this PR is not cleaning up everything, it's just a small start ;)

Changes Made

  • implements close() hooks for tts,sst and vad like in python (aclose)
  • deepgram STT resource cleanup

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
  • Video demo: A small video demo showing changes works as expected and did not break any existing functionality using Agent Playground (if applicable)

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

see also #837 (comment)


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

@changeset-bot
Copy link

changeset-bot bot commented Nov 19, 2025

🦋 Changeset detected

Latest commit: 7d966e8

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

This PR includes changesets to release 14 packages
Name Type
@livekit/agents Patch
@livekit/agents-plugin-deepgram Patch
@livekit/agents-plugin-anam Patch
@livekit/agents-plugin-bey Patch
@livekit/agents-plugin-cartesia Patch
@livekit/agents-plugin-elevenlabs Patch
@livekit/agents-plugin-google Patch
@livekit/agents-plugin-livekit Patch
@livekit/agents-plugin-neuphonic Patch
@livekit/agents-plugin-openai Patch
@livekit/agents-plugin-resemble Patch
@livekit/agents-plugin-rime Patch
@livekit/agents-plugin-silero 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

@toubatbrian toubatbrian self-requested a review November 20, 2025 12:25
@toubatbrian
Copy link
Contributor

Hey @simllll, have you tested this change locally?

@simllll
Copy link
Contributor Author

simllll commented Nov 20, 2025

Yes, tested and working. There is one "cosmetic" thing I foud in deepgram, give me some minutes, I will add the latest version.

Regarding resource cleanup in general:
Also this one is quite relevant livekit/node-sdks#575

@toubatbrian toubatbrian merged commit b0f5cce into livekit:main Nov 20, 2025
6 checks passed
@github-actions github-actions bot mentioned this pull request Nov 20, 2025
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