Skip to content

fix(voice-call): honor vadThreshold: 0 and silenceDurationMs: 0 in STT config#39196

Closed
scoootscooob wants to merge 1 commit intoopenclaw:mainfrom
scoootscooob:fix/stt-vad-threshold-zero
Closed

fix(voice-call): honor vadThreshold: 0 and silenceDurationMs: 0 in STT config#39196
scoootscooob wants to merge 1 commit intoopenclaw:mainfrom
scoootscooob:fix/stt-vad-threshold-zero

Conversation

@scoootscooob
Copy link
Copy Markdown
Contributor

Summary

  • Replace || with ?? for vadThreshold and silenceDurationMs defaults in OpenAIRealtimeSTTProvider
  • vadThreshold: 0 (max VAD sensitivity) and silenceDurationMs: 0 are valid per the Zod schema but were silently replaced with defaults

Test plan

  • Added 3 tests: explicit zero values respected, undefined falls back to defaults
  • All 3 tests pass

Fixes #39190

🤖 Generated with Claude Code

…T config

The constructor used || (logical OR) which drops valid 0 values.
vadThreshold: 0 is max VAD sensitivity per the schema z.number().min(0).max(1).
Switch to ?? (nullish coalescing) so only undefined/null triggers defaults.

Fixes openclaw#39190

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@openclaw-barnacle openclaw-barnacle bot added channel: voice-call Channel integration: voice-call size: XS labels Mar 7, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 7, 2026

Greptile Summary

This PR fixes a bug in OpenAIRealtimeSTTProvider where vadThreshold: 0 and silenceDurationMs: 0 — both valid values per the schema — were silently replaced with their defaults because || treats 0 as falsy. Replacing || with ?? (nullish coalescing) ensures the fallback only triggers for null/undefined, honoring explicit zero values as intended.

  • stt-openai-realtime.ts: Two-line change swapping || for ?? on the silenceDurationMs and vadThreshold assignments in the constructor.
  • stt-openai-realtime.test.ts: New test file with 3 well-targeted tests confirming zero values are respected and undefined still falls back to defaults.

Note: config.model || "gpt-4o-transcribe" on line 64 intentionally keeps || since an empty string is not a valid model name — this is consistent and correct.

Confidence Score: 5/5

  • This PR is safe to merge — the fix is minimal, targeted, and thoroughly tested.
  • The change is a two-line, well-understood operator swap (||??) with no side effects on other behavior. Three new unit tests directly validate the fixed and existing default cases. No other logic is touched.
  • No files require special attention.

Last reviewed commit: b959981

@steipete
Copy link
Copy Markdown
Contributor

steipete commented Mar 8, 2026

Landed on main after rebasing onto the latest origin/main.

What shipped:

  • switch voice-call OpenAI Realtime STT defaults from || to ?? so explicit vadThreshold: 0 and silenceDurationMs: 0 are preserved
  • add regression coverage for explicit zero values and the default fallback path
  • updated CHANGELOG.md
  • ran pnpm lint, pnpm build, and pnpm test

Landed commit:

Source PR commit:

Thanks @scoootscooob.

@steipete steipete closed this Mar 8, 2026
mcaxtr pushed a commit to mcaxtr/openclaw that referenced this pull request Mar 8, 2026
Landed from contributor PR openclaw#39196 by @scoootscooob.

Co-authored-by: scoootscooob <[email protected]>
Saitop pushed a commit to NomiciAI/openclaw that referenced this pull request Mar 8, 2026
Landed from contributor PR openclaw#39196 by @scoootscooob.

Co-authored-by: scoootscooob <[email protected]>
GordonSH-oss pushed a commit to GordonSH-oss/openclaw that referenced this pull request Mar 9, 2026
Landed from contributor PR openclaw#39196 by @scoootscooob.

Co-authored-by: scoootscooob <[email protected]>
jenawant pushed a commit to jenawant/openclaw that referenced this pull request Mar 10, 2026
Landed from contributor PR openclaw#39196 by @scoootscooob.

Co-authored-by: scoootscooob <[email protected]>
dhoman pushed a commit to dhoman/chrono-claw that referenced this pull request Mar 11, 2026
Landed from contributor PR openclaw#39196 by @scoootscooob.

Co-authored-by: scoootscooob <[email protected]>
senw-developers pushed a commit to senw-developers/va-openclaw that referenced this pull request Mar 17, 2026
Landed from contributor PR openclaw#39196 by @scoootscooob.

Co-authored-by: scoootscooob <[email protected]>
V-Gutierrez pushed a commit to V-Gutierrez/openclaw-vendor that referenced this pull request Mar 17, 2026
Landed from contributor PR openclaw#39196 by @scoootscooob.

Co-authored-by: scoootscooob <[email protected]>
alexey-pelykh pushed a commit to remoteclaw/remoteclaw that referenced this pull request Mar 22, 2026
Landed from contributor PR openclaw#39196 by @scoootscooob.

Co-authored-by: scoootscooob <[email protected]>
(cherry picked from commit 28b72e5)
alexey-pelykh added a commit to remoteclaw/remoteclaw that referenced this pull request Mar 22, 2026
… CI fixes (#1794)

* fix: honor explicit Synology Chat rate-limit env values

Landed from contributor PR openclaw#39197 by @scoootscooob.

Co-authored-by: scoootscooob <[email protected]>
(cherry picked from commit af9d76b)

* fix: honor zero-valued voice-call STT settings

Landed from contributor PR openclaw#39196 by @scoootscooob.

Co-authored-by: scoootscooob <[email protected]>
(cherry picked from commit 28b72e5)

* fix: honor explicit OpenAI TTS speed values

Landed from contributor PR openclaw#39318 by @ql-wade.

Co-authored-by: ql-wade <[email protected]>
(cherry picked from commit 442f2c3)

* Voice Call: allowlist realtime STT api key fixtures

(cherry picked from commit b8b6569)

* Voice Call: read TTS internals in tests

(cherry picked from commit b1f7cf4)

* Voice Call: read realtime STT internals in tests

(cherry picked from commit 244aabb)

* test: fix gate regressions

(cherry picked from commit 56cd008)

* refactor: normalize voice-call runtime defaults

(cherry picked from commit 3087893)

* refactor: preserve explicit mock voice-call values

(cherry picked from commit f6c7ff3)

* fix(ci): resolve type regressions on main

(cherry picked from commit f721141)

* refactor(voice-call): share tts deep merge

(cherry picked from commit ed43743)

* fix: land openclaw#33992 from @darkamenosa

Co-authored-by: Tom <[email protected]>
(cherry picked from commit fcdc1a1)

* fix(ci): repair zalouser CI failures

(cherry picked from commit 06ffef8)

* fix: resolve cherry-pick type errors in zalouser extension

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* fix: resolve cherry-pick type error in voice-call config test — adapt SecretRef to string apiKey

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

---------

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: scoootscooob <[email protected]>
Co-authored-by: ql-wade <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: Tom <[email protected]>
Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: voice-call Channel integration: voice-call size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: voice-call STT vadThreshold: 0 and silenceDurationMs: 0 silently ignored

2 participants