-
-
Notifications
You must be signed in to change notification settings - Fork 69.4k
bug: voice-call STT vadThreshold: 0 and silenceDurationMs: 0 silently ignored #39190
Copy link
Copy link
Open
Description
Bug
In extensions/voice-call/src/providers/stt-openai-realtime.ts:65-66, the constructor uses || (logical OR) instead of ?? (nullish coalescing) for default values:
this.silenceDurationMs = config.silenceDurationMs || 800;
this.vadThreshold = config.vadThreshold || 0.5;This drops valid 0 values:
vadThreshold: 0means maximum VAD sensitivity (detect everything as speech) — valid per the schemaz.number().min(0).max(1)and the OpenAI Realtime APIsilenceDurationMs: 0means no silence padding before triggering end-of-speech
When a user configures vadThreshold: 0, they silently get 0.5 instead.
Expected behavior
Use ?? so that 0 is respected and only undefined/null triggers the default:
this.silenceDurationMs = config.silenceDurationMs ?? 800;
this.vadThreshold = config.vadThreshold ?? 0.5;Impact
Medium — users who set vadThreshold: 0 for maximum sensitivity get medium sensitivity (0.5) without any error or warning.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackNo fields configured for issues without a type.