Skip to content

fix(voice): prevent recorder interruption deadlock - #2091

Merged
toubatbrian merged 2 commits into
mainfrom
fix/recorder-playout-wait-delegation
Jul 22, 2026
Merged

fix(voice): prevent recorder interruption deadlock#2091
toubatbrian merged 2 commits into
mainfrom
fix/recorder-playout-wait-delegation

Conversation

@toubatbrian

@toubatbrian toubatbrian commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • delegate recorder playout waits to the wrapped audio output so synchronized outputs can reconcile dropped interrupted segments
  • add a regression test covering downstream wait delegation
  • add a patch changeset for @livekit/agents

Test plan

  • Reproduced the pre-fix deadlock with chained Cue turns using Deepgram Nova-3, GPT-5.4, and Inworld TTS
  • Verified the same Cue scenario resolves after the fix
  • pnpm exec vitest run agents/src/voice/recorder_io/recorder_io.test.ts --exclude '.worktrees/**'
  • pnpm format:check
  • pnpm lint
  • pnpm typecheck
  • pnpm build

Ensure recorder wrappers allow downstream outputs to reconcile dropped interrupted segments before waiting on their own completion.

Co-authored-by: Cursor <cursoragent@cursor.com>
@toubatbrian
toubatbrian requested a review from a team as a code owner July 22, 2026 18:50
@changeset-bot

changeset-bot Bot commented Jul 22, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0fa6422

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

This PR includes changesets to release 38 packages
Name Type
@livekit/agents Patch
@livekit/agents-plugin-anam Patch
@livekit/agents-plugin-anthropic Patch
@livekit/agents-plugin-assemblyai Patch
@livekit/agents-plugin-azure Patch
@livekit/agents-plugin-baseten Patch
@livekit/agents-plugin-bey Patch
@livekit/agents-plugin-cartesia Patch
@livekit/agents-plugin-cerebras Patch
@livekit/agents-plugin-deepgram Patch
@livekit/agents-plugin-did Patch
@livekit/agents-plugin-elevenlabs Patch
@livekit/agents-plugin-fishaudio Patch
@livekit/agents-plugin-google Patch
@livekit/agents-plugin-hedra Patch
@livekit/agents-plugin-hume Patch
@livekit/agents-plugin-inworld Patch
@livekit/agents-plugin-lemonslice Patch
@livekit/agents-plugin-liveavatar Patch
@livekit/agents-plugin-livekit Patch
@livekit/agents-plugin-minimax Patch
@livekit/agents-plugin-mistral Patch
@livekit/agents-plugin-mistralai Patch
@livekit/agents-plugin-neuphonic Patch
@livekit/agents-plugin-openai Patch
@livekit/agents-plugin-perplexity Patch
@livekit/agents-plugin-phonic Patch
@livekit/agents-plugin-protoface Patch
@livekit/agents-plugin-resemble Patch
@livekit/agents-plugin-rime Patch
@livekit/agents-plugin-runway Patch
@livekit/agents-plugin-sarvam Patch
@livekit/agents-plugin-silero Patch
@livekit/agents-plugin-soniox Patch
@livekit/agents-plugin-tavus Patch
@livekit/agents-plugins-test Patch
@livekit/agents-plugin-trugen Patch
@livekit/agents-plugin-xai 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 chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e30acdb724

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread agents/src/voice/recorder_io/recorder_io.ts Outdated

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

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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

Keep each recorder wait scoped to segments present when the wait begins, even if a later reply starts during downstream reconciliation.

Co-authored-by: Cursor <cursoragent@cursor.com>
@toubatbrian
toubatbrian merged commit 82d93d0 into main Jul 22, 2026
6 checks passed
@toubatbrian
toubatbrian deleted the fix/recorder-playout-wait-delegation branch July 22, 2026 20:03
@github-actions github-actions Bot mentioned this pull request Jul 22, 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