Repository navigation
Voice agent always on streaming mode to support barge in - #326165
Merged
Megan Rogge (meganrogge) merged 3 commits intoJul 16, 2026
Merged
Megan Rogge (meganrogge) merged 3 commits into
Megan Rogge (meganrogge) merged 3 commits into
Conversation
Remove the unsupported outbound barge_in monitor messages and keep microphone streaming on the established PTT protocol. Clear playback suppression when PTT starts so backend VAD receives interruption audio immediately, while preserving the inbound barge_in playback cancellation event. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7972bf67-b7f5-4937-9ea8-b1b9a9f13e0d
Contributor
There was a problem hiding this comment.
Pull request overview
Replaces the dedicated barge-in monitoring protocol with continuous PTT streaming during hands-free playback.
Changes:
- Starts passive PTT streaming while responses play.
- Removes legacy barge-in monitor APIs and messages.
- Adds outbound PTT protocol coverage.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
voiceClientService.test.ts |
Tests outbound PTT messages. |
common/voiceClientService.ts |
Removes barge-in methods. |
voiceSessionController.ts |
Implements passive PTT barge-in listening. |
browser/voiceClientService.ts |
Removes legacy barge-in messages. |
micCaptureService.ts |
Removes dedicated monitor capture support. |
In hands-free mode, keep the mic streaming while the assistant speaks by opening a passive, non-interrupting PTT turn (_startBargeInListen) reusing the warm mic. This lets the backend's server-VAD hear the user talk over the assistant and emit speech_started / barge_in (already wired to stop TTS). If the user stays silent the turn simply becomes the next listening turn once playback ends. Non-hands-free (manual PTT) keeps its prior suppressUntil behavior. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e3a8372-08f2-4a5b-bdf4-ed2a29be4622
Mir (mirimadahmed)
force-pushed
the
mirimadahmed-microsoft-voice-always-on-streaming
branch
from
July 16, 2026 14:51
b90ce51 to
fd63c05
Compare
…sten The passive barge-in turn opened during assistant playback previously set `_pttToggleMode = true`. Pressing the mic button mid-playback then hit `pttDown()`'s toggle branch, which sent `ptt_end` and finalized the turn WITHOUT stopping playback — leaving the assistant talking and the manual interrupt broken. Track the passive listen with a dedicated `_bargeInListenActive` flag instead. An explicit `pttDown()` now promotes that live stream into a user-driven interrupt on the SAME turn (no second `ptt_start`, no mic re-acquire): it stops playback, drops queued audio, opens the user turn, re-anchors hold telemetry, and moves to listening. Releasing the button flows through the normal `pttUp()` path. If the user stays silent through playback, `onPlaybackStopped` converts the passive turn into a normal tap-to-stop listening turn (toggle mode + server-VAD auto-end). The flag is cleared in `_finishPtt()` and `disconnect()` for hygiene. Addresses the Copilot review comment on microsoft#326165. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e3a8372-08f2-4a5b-bdf4-ed2a29be4622
Megan Rogge (meganrogge)
approved these changes
Jul 16, 2026
Megan Rogge (meganrogge)
enabled auto-merge (squash)
July 16, 2026 17:53
roblourens
approved these changes
Jul 16, 2026
Connor Peet (connor4312)
approved these changes
Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
In hands-free voice mode (
agents.voice.handsFree), keep the microphone streaming while the assistant is speaking so the backend's server-VAD can detect the user talking over it (barge-in) — without requiring the user to hold the push-to-talk button.Why
After the #326159 cleanup the mic is off during assistant playback, so the backend receives no audio while it speaks and true hands-free barge-in is impossible — only a manual button interrupt works.
How
Adds
_startBargeInListen()toVoiceSessionController. During playback (hands-free only) it opens a passive, non-interrupting PTT turn that reuses the warm mic and streams frames using the standard PTT protocol (ptt_start/ptt_audio_chunk/ptt_end) — not the removedbarge_in_*channel. The backend's_handle_ptt_audio_chunk()runs VAD and, on real speech, cancels its TTS and emitsbarge_in(already wired to_interruptAssistantPlayback).Key properties:
onPlaybackStoppedsees_pttHeld).suppressUntil(+800)behavior unchanged.Testing
VoiceClientServiceunit tests pass (barge-in events + PTT protocol).npm run typecheck-clientclean.