Repository navigation
fix(silero,inference): recalculate deactivation_threshold when activation_threshold updated - #8566
Open
muntazir868 wants to merge 4 commits into
Open
muntazir868 wants to merge 4 commits into
muntazir868 wants to merge 4 commits into
Conversation
…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
force-pushed
the
fix/silero-vad-update-options
branch
from
November 21, 2026 19:35
dc9a893 to
a605e71
Compare
This branch has not been deployed
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
When
VAD.update_options(activation_threshold=...)is called without an explicitdeactivation_threshold, recalculate it using the same formula asload():This fixes the bug where
update_optionskept the olddeactivation_threshold, causing different behavior fromload()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 fixupstream/main(d78f39990)Closes #7597