diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bffbf047dc..aac7ee61817 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -70,6 +70,7 @@ Docs: https://docs.openclaw.ai - Cron/OpenAI Codex OAuth refresh hardening: when `openai-codex` token refresh fails specifically on account-id extraction, reuse the cached access token instead of failing the run immediately, with regression coverage to keep non-Codex and unrelated refresh failures unchanged. (#36604) Thanks @laulopezreal. - TUI/session isolation for `/new`: make `/new` allocate a unique `tui-` session key instead of resetting the shared agent session, so multiple TUI clients on the same agent stop receiving each other’s replies; also sanitize `/new` and `/reset` failure text before rendering in-terminal. Landed from contributor PR #39238 by @widingmarcus-cyber. Thanks @widingmarcus-cyber. - Synology Chat/rate-limit env parsing: honor `SYNOLOGY_RATE_LIMIT=0` as an explicit value while still falling back to the default limit for malformed env values instead of partially parsing them. Landed from contributor PR #39197 by @scoootscooob. Thanks @scoootscooob. +- Voice-call/OpenAI Realtime STT config defaults: honor explicit `vadThreshold: 0` and `silenceDurationMs: 0` instead of silently replacing them with defaults. Landed from contributor PR #39196 by @scoootscooob. Thanks @scoootscooob. - Cron/file permission hardening: enforce owner-only (`0600`) cron store/backup/run-log files and harden cron store + run-log directories to `0700`, including pre-existing directories from older installs. (#36078) Thanks @aerelune. - Gateway/remote WS break-glass hostname support: honor `OPENCLAW_ALLOW_INSECURE_PRIVATE_WS=1` for `ws://` hostname URLs (not only private IP literals) across onboarding validation and runtime gateway connection checks, while still rejecting public IP literals and non-unicast IPv6 endpoints. (#36930) Thanks @manju-rn. - Routing/binding lookup scalability: pre-index route bindings by channel/account and avoid full binding-list rescans on channel-account cache rollover, preventing multi-second `resolveAgentRoute` stalls in large binding configurations. (#36915) Thanks @songchenghao. diff --git a/extensions/voice-call/src/providers/stt-openai-realtime.test.ts b/extensions/voice-call/src/providers/stt-openai-realtime.test.ts new file mode 100644 index 00000000000..c15d5c97d99 --- /dev/null +++ b/extensions/voice-call/src/providers/stt-openai-realtime.test.ts @@ -0,0 +1,38 @@ +import { describe, expect, it } from "vitest"; +import type { RealtimeSTTConfig } from "./stt-openai-realtime.js"; +import { OpenAIRealtimeSTTProvider } from "./stt-openai-realtime.js"; + +type ProviderInternals = OpenAIRealtimeSTTProvider & { + vadThreshold: number; + silenceDurationMs: number; +}; + +function createProvider(config: RealtimeSTTConfig): ProviderInternals { + return new OpenAIRealtimeSTTProvider(config) as ProviderInternals; +} + +describe("OpenAIRealtimeSTTProvider constructor defaults", () => { + it("uses vadThreshold: 0 when explicitly configured (max sensitivity)", () => { + const provider = createProvider({ + apiKey: "sk-test", + vadThreshold: 0, + }); + expect(provider.vadThreshold).toBe(0); + }); + + it("uses silenceDurationMs: 0 when explicitly configured", () => { + const provider = createProvider({ + apiKey: "sk-test", + silenceDurationMs: 0, + }); + expect(provider.silenceDurationMs).toBe(0); + }); + + it("falls back to defaults when values are undefined", () => { + const provider = createProvider({ + apiKey: "sk-test", + }); + expect(provider.vadThreshold).toBe(0.5); + expect(provider.silenceDurationMs).toBe(800); + }); +}); diff --git a/extensions/voice-call/src/providers/stt-openai-realtime.ts b/extensions/voice-call/src/providers/stt-openai-realtime.ts index 2ae83cc0f35..ec8149f2239 100644 --- a/extensions/voice-call/src/providers/stt-openai-realtime.ts +++ b/extensions/voice-call/src/providers/stt-openai-realtime.ts @@ -62,8 +62,8 @@ export class OpenAIRealtimeSTTProvider { } this.apiKey = config.apiKey; this.model = config.model || "gpt-4o-transcribe"; - this.silenceDurationMs = config.silenceDurationMs || 800; - this.vadThreshold = config.vadThreshold || 0.5; + this.silenceDurationMs = config.silenceDurationMs ?? 800; + this.vadThreshold = config.vadThreshold ?? 0.5; } /**