Skip to content

Conversation

@sam-s10s
Copy link
Contributor

@sam-s10s sam-s10s commented Dec 22, 2025

What's Changed?

  • Migrated from Speechmatics Real-Time SDK to new Voice SDK
  • Improved performance of the STT engine
  • Improved handling of speaker start / end events
  • Better handing of background speakers when in focus mode

Deprecation Warning

  • The end_of_utterance_mode has been changed to turn_detection_mode to reduce ambiguity
  • Use TurnDetectionMode.EXTERNAL (default) for any VAD within LiveKit
  • Use TurnDetectionMode.ADAPTIVE or TurnDetectionMode.SMART_TURN to use the plugin VAD / turn detection

Open with Devin

Copy link
Contributor

@longcw longcw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! could you help to resolve the conflicts with the main branch. and something nit:

@chenghao-mou
Copy link
Member

chenghao-mou commented Jan 6, 2026

/test-stt

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 4 potential issues.

View issues and 7 additional flags in Devin Review.

Open in Devin Review

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

View issue and 12 additional flags in Devin Review.

Open in Devin Review

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

View issue and 12 additional flags in Devin Review.

Open in Devin Review

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 new potential issues.

View issues and 13 additional flags in Devin Review.

Open in Devin Review

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

View issue and 14 additional flags in Devin Review.

Open in Devin Review

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

View issue and 15 additional flags in Devin Review.

Open in Devin Review

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

View issue and 16 additional flags in Devin Review.

Open in Devin Review

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 4 new potential issues.

View issues and 19 additional flags in Devin Review.

Open in Devin Review

commit c46013d
Author: Long Chen <[email protected]>
Date:   Tue Feb 3 20:02:57 2026 +0800

    add exclude_config_update to ChatContext copy (livekit#4700)

commit 7849a8c
Author: Chenghao Mou <[email protected]>
Date:   Tue Feb 3 09:51:07 2026 +0000

    fix: commit user turn with STT and realtime (livekit#4663)

commit edfa391
Author: Chenghao Mou <[email protected]>
Date:   Tue Feb 3 09:48:36 2026 +0000

    add STT usage for google (livekit#4599)

commit 34d0d62
Author: Long Chen <[email protected]>
Date:   Tue Feb 3 15:53:42 2026 +0800

    fix gemini live tool execution interrupted by generation_complete event (livekit#4699)

commit 1725929
Author: Long Chen <[email protected]>
Date:   Tue Feb 3 11:08:27 2026 +0800

    prevent tool cancellation when AgentTask is called inside it (livekit#4586)
Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

View issue and 28 additional flags in Devin Review.

Open in Devin Review

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

View issue and 28 additional flags in Devin Review.

Open in Devin Review

@sam-s10s sam-s10s closed this Feb 3, 2026
Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

View issue and 29 additional flags in Devin Review.

Open in Devin Review

Comment on lines +768 to 773
old_allow_interruptions = speech_handle.allow_interruptions
speech_handle.allow_interruptions = False

blocked_tasks = [current_task]
if (
old_activity._on_enter_task

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 SpeechHandle.allow_interruptions not restored if session._update_activity raises

In the InlineTask.__await_impl__ method, speech_handle.allow_interruptions is set to False before entering the try block, but restoration only occurs in the finally block. If session._update_activity() raises an exception (line 790), the finally block never executes and allow_interruptions remains permanently disabled.

Click to expand

Code flow showing the issue:

# Line 768-769: allow_interruptions is set to False
old_allow_interruptions = speech_handle.allow_interruptions
speech_handle.allow_interruptions = False

# Lines 770-790: Various setup code runs OUTSIDE try block
blocked_tasks = [current_task]
# ...
await session._update_activity(...)  # If this raises, finally won't run!

# Line 801-806: try/finally starts here
try:
    return await asyncio.shield(self.__fut)
finally:
    if speech_handle:
        speech_handle.allow_interruptions = old_allow_interruptions  # Never reached if above throws

Impact:

If _update_activity fails for any reason (network issues, invalid state, etc.), the speech handle will be stuck with allow_interruptions=False, preventing all future interruptions for that speech. This could cause the agent to become uninterruptible, leading to a poor user experience where users cannot stop the agent from speaking.

(Refers to lines 768-790)

Recommendation: Move the speech_handle.allow_interruptions = False assignment inside the try block, or wrap the entire section from line 768 to the try block in a try/finally to ensure restoration happens regardless of where exceptions occur.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@sam-s10s sam-s10s deleted the smx/stt-voice-sdk branch February 3, 2026 15:30
@sam-s10s
Copy link
Contributor Author

sam-s10s commented Feb 3, 2026

LGTM! could you help to resolve the conflicts with the main branch. and something nit:

I have closed this PR and created a new one as the code base was far a drift from master.

#4703

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants