Skip to content

fix(silero,inference): recalculate deactivation_threshold when activation_threshold updated - #8566

Open
muntazir868 wants to merge 4 commits into
livekit:mainfrom
muntazir868:fix/silero-vad-update-options
Open

muntazir868 wants to merge 4 commits into
livekit:mainfrom
muntazir868:fix/silero-vad-update-options

Conversation

@muntazir868

@muntazir868 muntazir868 commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

When VAD.update_options(activation_threshold=...) is called without an explicit deactivation_threshold, recalculate it using the same formula as load():

deactivation_threshold = max(activation_threshold - 0.15, 0.01)

This fixes the bug where update_options kept the old deactivation_threshold, causing different behavior from load() with the same activation threshold.

The fix covers both the local Silero VAD (including its active streams) and Inference VAD.

Testing

  • uv run pytest tests/test_vad_update_options.py -q (6 passed)
  • uv run --group typing mypy --untyped-calls-exclude=smithy_aws_core --platform linux -p livekit.agents -p livekit.plugins.silero (244 source files, no issues)
  • make fix
  • rebased onto current upstream/main (d78f39990)

Closes #7597

@muntazir868
muntazir868 requested a review from a team as a code owner November 14, 2026 17:01

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

…tion_threshold updated

When VAD.update_options(activation_threshold=...) is called without an explicit
deactivation_threshold, recalculate it using the same formula as load():
deactivation_threshold = max(activation_threshold - 0.15, 0.01).

This fixes the bug where update_options kept the old deactivation_threshold,
causing different behavior vs load() with the same activation_threshold.

Affected:
- livekit-plugins-silero VAD and VADStream
- livekit-agents inference VAD and _VADStream
@muntazir868
muntazir868 force-pushed the fix/silero-vad-update-options branch from dc9a893 to a605e71 Compare November 21, 2026 19:35

This branch has not been deployed

No deployments
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.

silero: VAD.update_options(activation_threshold=...) keeps the old deactivation_threshold, so it disagrees with VAD.load

1 participant