Skip to content

meet: barge-in cancellation of in-flight TTS#25982

Merged
siddseethepalli merged 1 commit into
mainfrom
run-plan/meet-phase-3-voice/pr-3
Apr 16, 2026
Merged

meet: barge-in cancellation of in-flight TTS#25982
siddseethepalli merged 1 commit into
mainfrom
run-plan/meet-phase-3-voice/pr-3

Conversation

@siddseethepalli

@siddseethepalli siddseethepalli commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds MeetBargeInWatcher that subscribes to SpeakerChangeEvent + interim TranscriptChunkEvent and meet.speaking_* events
  • Cancels in-flight TTS via MeetSessionManager.cancelSpeak when a non-bot speaker takes the floor while the bot is speaking
  • 250ms debounce prevents brief non-bot blips from triggering cancel; watcher is hooked into MeetSessionManager.join

Part of plan: meet-phase-3-voice.md (PR 3 of 6)


Open with Devin

@siddseethepalli siddseethepalli merged commit 95434c7 into main Apr 16, 2026
@siddseethepalli siddseethepalli deleted the run-plan/meet-phase-3-voice/pr-3 branch April 16, 2026 00:32

@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 potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

@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: 37cec579df

ℹ️ 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 on lines +295 to +297
if (message.type === "meet.speaking_ended") {
this.isBotSpeaking = false;
// Stream is over — any pending cancel for this stream is moot.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Track speaking state per stream ID

onAssistantEvent flips isBotSpeaking to false on any meet.speaking_ended, but TTS playback is stream-based and can overlap (the bridge tracks multiple active stream IDs). If stream A ends while stream B is still playing, the watcher will think the bot is no longer speaking and will ignore real barge-in events during stream B, so cancelSpeak is never invoked when needed. Use streamId to maintain an active-stream set/count rather than a single boolean.

Useful? React with 👍 / 👎.

Comment on lines +171 to +173
assistantEventHub.subscribe(
{ assistantId: DAEMON_INTERNAL_ASSISTANT_ID },
cb,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid per-meeting subscriptions to the global event hub

Constructing one watcher per meeting now adds one assistantEventHub subscription per meeting, but that hub has a fixed subscriber cap (100) and evicts the oldest subscriber at capacity. As meeting count grows, this can evict unrelated subscribers (e.g., long-lived SSE listeners) or older meeting watchers, causing dropped client streams or disabled barge-in behavior in active sessions. A shared meet-speaking listener (or direct session-manager signal) avoids consuming a global slot per meeting.

Useful? React with 👍 / 👎.

@siddseethepalli

Copy link
Copy Markdown
Contributor Author

Follow-up fix merged in #26267 — addresses stream_id reuse race, barge-in overlap tracking, ffmpeg probe cache transient errors, playbackChain deadlock, and cancel DELETE timeout.

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