Skip to content

Allow cancellation even when allow_interruptions is False #4432

@chenghao-mou

Description

@chenghao-mou

Feature Type

Nice to have

Feature Description

This stems from the conversations in #4418 and #4413.

The core issue is that when we create a speech that has allow_interruptions set to False, we don't have a way to reliably stop or cancel it before it's played, even if the customer continues to speak after it's being scheduled. This also makes the cancellation of a tool call with say/generate_reply invoked indeterministic, esp since the introduction of #4102

Scenario 1: (current behavior)

  • user says something
  • agent speech (allow_interruptions=False) scheduled
  • user continues speaking, preventing the agent speech from being played
  • agent speech plays when the user stops speaking, but new user input is skipped

In this case, the agent would appear missing input

Scenario 2: (old behavior)

  • user says something
  • agent speech (allow_interruptions=False) scheduled
  • user continues speaking
  • agent speech plays, overlapping with user's speech

Here, the agent would appear "impatient"

Scenario 3: (ideal behavior)

  • user says something
  • agent speech (allow_interruptions=False) scheduled
  • user continues speaking, leading to cancellation of the scheduled agent speech
  • new agent speech (allow_interruptions=False) scheduled and then played

Workarounds / Alternatives

  • restore old behavior by checking speech handle flags; or
  • introduce new ways of speech cancellation

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions