Skip to content

Manual mode: VAD START_OF_SPEECH cancels a committed user turn and strands _user_turn_committed #7010

Description

@vignesh-koruverse

commit_user_turn() resolves after scheduling the end-of-turn bounce, which sleeps the endpointing delay before delivering the turn. With turn_detection="manual", a VAD START_OF_SPEECH inside that window cancels the pending task unconditionally (audio_recognition.py, SOS handler). Audio tail around a push-to-talk release (last syllable, breath, button noise) is enough to raise it.

Two problems compound:

  1. The cancel is silent. No reply is generated and nothing is logged. In manual mode the eou task always belongs to a turn the application already committed, so the VAD is overriding an explicit commit.
  2. The cancelled bounce skips its turn-scoped cleanup, so _user_turn_committed stays set and _on_stt_event discards every later transcript until the next commit flushes the stale buffer.

Observed in production (push-to-talk voice app, default injected Silero VAD): a user asked a question, got silence, repeated it; the repeat's audio was also discarded, and the eventual reply was generated from the stale buffer of the first attempt.

Repro: manual mode, commit a turn, deliver a VAD START_OF_SPEECH during the endpointing sleep. The turn never delivers and later finals are dropped. A failing test is included in the linked PR.

Same cancellation-poisoning class as #6913 and #6897. PR with fix and regression tests: #7011.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions