Fix redundant Voice Live response cancellation on speech start - #380
Open
Yulin Li (yulin-li) wants to merge 1 commit into
Open
Fix redundant Voice Live response cancellation on speech start#380Yulin Li (yulin-li) wants to merge 1 commit into
Yulin Li (yulin-li) wants to merge 1 commit into
Conversation
Let the service interrupt active responses and keep local playback clearing in the Python, JavaScript, Java, and .NET agent quickstarts. Remove cancellation-only state and error suppression. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Yulin Li (yulin-li)
marked this pull request as ready for review
September 6, 2026 17:20
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Purpose
Voice Live already interrupts the active response when it detects user speech. The Python, JavaScript, Java, and .NET Agent V2 quickstarts redundantly cancel that response again when handling
input_audio_buffer.speech_started.Remove the four automatic cancellation calls, their response-state flags, and cancellation-specific error suppression. Keep immediate local playback clearing, proactive greetings, audio processing, session configuration, and authentication unchanged. There are no manual response-cancellation calls or explicitly disabled automatic-interruption cases in these samples.
Does this introduce a breaking change?
Pull Request Type
What kind of change does this Pull Request introduce?
How to Test
git clone --branch fix/voicelive-service-interruption https://github.com/yulin-li/cognitive-services-quickstart-code.git cd cognitive-services-quickstart-codepython3 -m py_compile python/Speech/voice-live-with-agent-v2.py node --check javascript/speech/voice-live-with-agent-v2.js dotnet build dotnet/Speech/VoiceLiveWithAgent.csproj mvn -q -f java/Speech/pom-agent.xml dependency:build-classpath -Dmdep.outputFile=/tmp/voicelive-classpath.txt mkdir -p /tmp/voicelive-classes javac -encoding UTF-8 --release 11 -cp "$(cat /tmp/voicelive-classpath.txt)" -d /tmp/voicelive-classes java/Speech/VoiceLiveWithAgentV2.javaPython syntax parsing, JavaScript syntax checking, the .NET build, and direct Java compilation passed. Isolated before/after Python and JavaScript event checks reproduced the redundant cancels on the base revision and confirmed none are sent after this change, while playback clearing, subsequent audio, proactive greetings, and error reporting remain functional.
What to Check
Verify that the following are valid
Other Information
No live microphone/service session was run. No SDK APIs, dependencies, authentication, unrelated services, or agent-creation configuration were changed.