Repository navigation
fix(voice): reset realtime agent state without audio output - #7869
Merged
longcw merged 3 commits intoOct 21, 2026
Merged
Conversation
longcw
reviewed
Oct 19, 2026
| self._session._update_agent_state( | ||
| "thinking" if self._background_speeches else "listening" | ||
| ) | ||
| self._on_end_of_agent_speech(ended_at=time.time()) |
Contributor
There was a problem hiding this comment.
One more line needs to move too. The start of every realtime reply calls _disable_vad_interruption_soon() with or without audio output, so interruption_by_audio_activity_enabled turns off. Re-enable it with no condition, the same as _on_pipeline_reply_done does. If it stays behind if audio_output is not None:, a session with audio input and text output loses VAD interruption after its first reply.
With that, the remaining ATTR_SPEECH_INTERRUPTED line in the guard repeats the one just above it, so the if audio_output is not None: block can be removed.
Contributor
Author
There was a problem hiding this comment.
Updated the PR with the fix. Thank you for the correction!
longcw
approved these changes
Oct 21, 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 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.
Summary
Fixes #7866.
Realtime text replies could leave the agent in
speaking, keep audio recognition in its speaking interval, and leave VAD interruption disabled when audio output was missing or disabled.Run the existing state reset, recognition end hook, and interruption reset independently of audio output, preserving the interruption-enabled check and background-speech
thinkingstate. Remove the duplicate interrupted-span assignment.Regression tests cover returning to
listening, delivering the next user transcript without an interruption verdict, and interrupting a subsequent pending reply through VAD, with missing or disabled audio output.Validation
The two new VAD regression cases fail on the previous PR head and pass with this correction. All 205 selected realtime/interruption tests pass, along with repository lint and formatting, core type checking across 229 source files, and wheel/source-package builds.
Full-repository tests and all-plugin type checking remain unverified because optional dependencies are missing locally. No live-provider calls were made.