Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

feat(voice): the Thinking pause starts at Automatic, so a call answers on the provider's own timing

rubenluetke10-beep95b247372f32
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3181f03863..a031f4b674 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,18 @@ versioning per [SemVer](https://semver.org/).
## [Unreleased]
+### Changed
+
+- **A voice call answers on the provider's own timing again.** The Thinking
+ pause now starts at *Automatic*, and automatic means Jarvis sends no
+ turn-detection override at all: a realtime model ends the turn exactly when
+ its own API does, and the classic pipeline keeps its 1.5 s rule. The fixed
+ 1.5 s window added on 2026-08-18 sat on top of turn detection the provider
+ already does, so every finished sentence waited twice and a call felt
+ noticeably slower than the vendor's own client. Waiting longer is still one
+ click away: any value on the slider sends both the window and the
+ "read a pause as a pause" sensitivity that protects it.
+
### Added
- **Grok Build in the Open-beside menu.** The official `grok` CLI is now a
diff --git a/jarvis/core/config.py b/jarvis/core/config.py
index 4a22b73b14..f804a69713 100644
--- a/jarvis/core/config.py
+++ b/jarvis/core/config.py
@@ -2830,13 +2830,42 @@ class SpeechConfig(BaseModel):
completeness: CompletenessConfig = Field(default_factory=CompletenessConfig)
- # Voice endpoint silence window: how long the VAD waits in silence before
- # treating an utterance as finished. User-tunable "think buffer" (desktop
- # Settings → Voice slider). Range-clamped 500–5000 ms; default 1500 ms
- # ("1.5s rule"). Read at SpeechPipeline construction and live-applied via the
+ # Voice endpoint silence window: how long a voice engine waits in silence
+ # before treating an utterance as finished. User-tunable "think buffer"
+ # (desktop Settings → Voice slider).
+ #
+ # 0 = AUTOMATIC and the default: every engine keeps its own factory turn
+ # detection. For the classic pipeline that is the built-in 1.5 s window; for
+ # a realtime transport it means Jarvis sends NO turn-detection override at
+ # all, so the provider ends the turn on its own timing — the same latency a
+ # caller gets straight from the vendor's API. A fixed window layered on top
+ # of a provider that already endpoints natively made every finished
+ # sentence wait twice (maintainer, 2026-08-23: "it should just be what the
+ # API does out of the box").
+ #
+ # Any other value (500–5000 ms) is an EXPLICIT patience override and
+ # applies to both engines: the classic VAD uses it directly, and a realtime
+ # session forwards it as the provider's silence window plus the "read a
+ # pause as a pause" sensitivity. That is the 2026-08-18 behaviour, kept as
+ # an opt-in for a user who would rather wait than be cut off mid-sentence.
+ #
+ # Read at SpeechPipeline construction and live-applied via the
# /api/settings/silence-window route. extra="allow" already on SpeechConfig
# keeps the self-mod pre-validate pipeline safe (AP-16).
- vad_silence_ms: int = Field(default=1500, ge=500, le=5000)
+ vad_silence_ms: int = Field(default=0, ge=0, le=5000)
+
+ @field_validator("vad_silence_ms")
+ @classmethod
+ def _bound_silence_window(cls, value: int) -> int:
+ """0 stays 0 (automatic); anything positive lands inside 500–5000 ms.
+
+ The gap below 500 ms is not a valid patience setting — it would cut a
+ talker off between words — so a stray small value is raised to the
+ floor rather than rejected: a typo must never make the app unbootable.
+ """
+ if value <= 0:
+ return 0
+ return max(500, min(5000, int(value)))
#: Every language the speech recogniser can transcribe, as ISO-639-1 codes (a
diff --git a/jarvis/core/config_writer.py b/jarvis/core/config_writer.py
index 09fe0f0c89..fe0ee87dd6 100644
--- a/jarvis/core/config_writer.py
+++ b/jarvis/core/config_writer.py
@@ -1388,12 +1388,15 @@ def set_realtime_fallback_provider(provider: str, *, path: Path = DEFAULT_CONFIG
def set_silence_window_ms(ms: int, *, path: Path = DEFAULT_CONFIG_FILE) -> None:
"""Persist the voice silence window to ``[speech] vad_silence_ms`` in jarvis.toml.
- Clamps to the same 500–5000 ms bounds the config field enforces, so a stray
- value can never wedge endpointing. TOML-only by design (not in the
- drift-guard's reference snapshot, like :func:`set_overlay_style`); the
- Settings route applies the change live, this persists the boot default.
- """
- clamped = max(500, min(5000, int(ms)))
+ Clamps exactly as the config field does: 0 means AUTOMATIC (every voice
+ engine keeps its own factory turn detection) and survives untouched, while
+ any positive value lands inside 500–5000 ms, so a stray value can never
+ wedge endpointing. TOML-only by design (not in the drift-guard's reference
+ snapshot, like :func:`set_overlay_style`); the Settings route applies the
+ change live, this persists the boot default.
+ """
+ raw = int(ms)
+ clamped = 0 if raw <= 0 else max(500, min(5000, raw))
_patch_table(path, "speech", "vad_silence_ms", clamped)
diff --git a/jarvis/plugins/realtime/gemini_live.py b/jarvis/plugins/realtime/gemini_live.py
index 83c83d78c7..0bd658e5e8 100644
--- a/jarvis/plugins/realtime/gemini_live.py
+++ b/jarvis/plugins/realtime/gemini_live.py
@@ -1166,7 +1166,10 @@ class GeminiLiveProvider:
# silence window. The user's Thinking pause (``turn_pause_ms``, the
# same Settings value the classic pipeline endpoints on) is folded in
# here; an explicit ``silence_duration_ms`` override still wins, and
- # with neither set Gemini keeps deciding turn ends on its own timing.
+ # with neither set — the DEFAULT since 2026-08-23 — Gemini keeps
+ # deciding turn ends on its own timing, which is the whole point: a
+ # window layered on top of native endpointing made every finished
+ # sentence wait twice as long as the vendor's own client does.
# A user who resumes inside the window continues the SAME activity —
# the words append, nothing is submitted twice (2026-08-18).
silence_ms = getattr(cfg, "silence_duration_ms", None) or getattr(
diff --git a/jarvis/realtime/protocol.py b/jarvis/realtime/protocol.py
index 9325bbd26d..2040b7f412 100644
--- a/jarvis/realtime/protocol.py
+++ b/jarvis/realtime/protocol.py
@@ -110,14 +110,17 @@ class RealtimeSessionConfig:
silence_duration_ms: int | None = None
# How eagerly the provider's native VAD may declare the user finished.
# "low" = read a pause as a pause; "high" = the provider's own eager
- # default; None = send nothing and inherit whatever the provider ships.
- # End-of-speech sensitivity changes only how a PAUSE is interpreted, so a
- # finished short sentence still commits immediately while a hesitation
- # inside a long order no longer ends the turn (live 2026-08-13
- # 16:46/16:47: a spoken brief for a coding pane was closed twice
- # mid-sentence and delivered truncated). Providers without the concept
- # ignore it.
- end_of_speech_sensitivity: str | None = "low"
+ # default; None — the DEFAULT — = send nothing and inherit whatever the
+ # provider ships. End-of-speech sensitivity changes only how a PAUSE is
+ # interpreted, so a finished short sentence still commits immediately
+ # while a hesitation inside a long order no longer ends the turn (live
+ # 2026-08-13 16:46/16:47: a spoken brief for a coding pane was closed
+ # twice mid-sentence and delivered truncated). It travels WITH
+ # ``turn_pause_ms``: the session sends "low" only when the user has asked
+ # for a patience window, because patience without the window is a
+ # half-measure and the window without patience is the wait with none of
+ # its protection. Providers without the concept ignore it.
+ end_of_speech_sensitivity: str | None = None
# How long the user may PAUSE before their turn is taken — the Settings
# "Thinking pause" (SpeechConfig.vad_silence_ms), one value for both voice
# engines since 2026-08-18. Which lever applies is a transport
@@ -142,7 +145,13 @@ class RealtimeSessionConfig:
# asked for the opposite — wait for a clear pause, and keep listening
# while the sentence continues — so the pause is back, as the SAME
# setting the classic pipeline uses, adjustable in Settings → Voice.
- # None = the provider's own timing (tests, callers without a config).
+ # None — the DEFAULT — = the provider's own timing: no window is sent and
+ # none is waited out locally, so a turn ends exactly when the provider's
+ # factory detection says it does. Layering a window on a transport that
+ # already endpoints natively made every finished sentence wait twice and
+ # the extra wait was audible against the vendor's own client, so the
+ # Settings slider now starts at "automatic" and only an explicit value
+ # travels (maintainer, 2026-08-23).
turn_pause_ms: int | None = None
tools: tuple[dict[str, Any], ...] = ()
# Bounded transcript of the call so far, oldest first, as
diff --git a/jarvis/realtime/session.py b/jarvis/realtime/session.py
index c0edd4882a..522d1ffc08 100644
--- a/jarvis/realtime/session.py
+++ b/jarvis/realtime/session.py
@@ -425,7 +425,13 @@ _UTTERANCE_TAIL_SETTLE_S = 2.5
# receives the same value as its native silence window instead
# (``RealtimeSessionConfig.turn_pause_ms``). Maintainer directive
# 2026-08-18: "wait for a clear pause; when I keep talking, append."
-_TURN_PAUSE_DEFAULT_MS = 1_500
+#
+# There is no DEFAULT window any more: unset (``speech.vad_silence_ms = 0``)
+# means automatic, and automatic means the provider's factory turn detection
+# decides alone — nothing is sent to it and nothing is held back here. These
+# bounds apply only to a value the user chose deliberately (maintainer
+# 2026-08-23: the layered window made every finished sentence wait twice as
+# long as the vendor's own client).
_TURN_PAUSE_MIN_MS = 500
_TURN_PAUSE_MAX_MS = 5_000
# How often the pause waiter re-checks the microphone. Fine enough that a
@@ -3620,6 +3626,9 @@ class RealtimeVoiceSession:
_PROVIDER_HANDSHAKE_TOTAL_TIMEOUT_S, declared_total
)
last_failed_provider = ""
+ # Read the Thinking pause ONCE per open so the window and the
+ # sensitivity that belongs to it can never disagree mid-handshake.
+ turn_pause_ms = self._turn_pause_ms()
for provider in self._providers:
if not self._provider_is_available(provider):
continue
@@ -3667,7 +3676,16 @@ class RealtimeVoiceSession:
# transport ignores it because THIS session waits out the
# same pause on the microphone before requesting the response
# (``_turn_pause_settled``). One setting, both engines.
- turn_pause_ms=self._turn_pause_ms(),
+ #
+ # None is the DEFAULT and means factory turn detection: no
+ # window, and no end-of-speech patience either. Both knobs
+ # move together because they are one intent — "be patient
+ # with my pauses" — and half of it is the worst of both: the
+ # wait without the protection it was added for. Sending
+ # neither is exactly what a caller gets from the vendor's own
+ # API, which is what the maintainer asked for on 2026-08-23.
+ turn_pause_ms=turn_pause_ms,
+ end_of_speech_sensitivity="low" if turn_pause_ms else None,
tools=self._declared_tools(),
# Empty at the first open of a call; after an in-place
# transport rebuild (or a mid-call cross-family fallback) it
@@ -4061,23 +4079,33 @@ class RealtimeVoiceSession:
# The Thinking pause: how long the user may pause before the turn is taken
# ------------------------------------------------------------------
- def _turn_pause_ms(self) -> int:
- """The user's Thinking pause in ms, read live from the config.
+ def _turn_pause_ms(self) -> int | None:
+ """The user's Thinking pause in ms, or None for the provider's own timing.
The Settings → Voice slider writes ``speech.vad_silence_ms`` into the
running config, so a manual-response transport picks a new value up on
the very next turn; an automatic-response transport bakes it into its
- native turn detection at open and follows on the next call. Clamped to
- the field's own bounds — a stray value can slow a call, never wedge it.
+ native turn detection at open and follows on the next call.
+
+ ZERO — the default — means AUTOMATIC and returns None: no window is
+ sent to the provider and none is waited out here, so the turn ends
+ exactly when the provider's factory detection says it does. A window
+ layered on top of a transport that already endpoints natively made
+ every finished sentence wait twice, and the extra wait was audible
+ (maintainer, 2026-08-23). A positive value is an explicit patience
+ override and is clamped to the field's own bounds — a stray value can
+ slow a call, never wedge it.
"""
speech_cfg = getattr(self._config, "speech", None)
raw = getattr(speech_cfg, "vad_silence_ms", None)
try:
- ms = int(raw) if raw is not None else _TURN_PAUSE_DEFAULT_MS
+ ms = int(raw) if raw is not None else 0
except (TypeError, ValueError):
# A non-numeric slider value is a config typo, not a fault: the
- # default keeps the call usable, and the clamp below bounds it.
- ms = _TURN_PAUSE_DEFAULT_MS
+ # provider's own timing keeps the call usable and fast.
+ ms = 0
+ if ms <= 0:
+ return None
return max(_TURN_PAUSE_MIN_MS, min(_TURN_PAUSE_MAX_MS, ms))
def _turn_pause_settled(self) -> bool:
@@ -4104,11 +4132,16 @@ class RealtimeVoiceSession:
"""
if self._user_speech_active:
return False
+ pause_ms = self._turn_pause_ms()
+ if pause_ms is None:
+ # Automatic: the provider's own end-of-turn detection is the only
+ # authority, so there is nothing here to wait for.
+ return True
stamp = self._last_voiced_input_monotonic
if not stamp:
return True
now = time.monotonic()
- if (now - stamp) < self._turn_pause_ms() / 1000.0:
+ if (now - stamp) < pause_ms / 1000.0:
return False
stream_age = now - self._last_input_frame_monotonic
return not (_MIC_FRAME_STALL_S < stream_age < _MIC_STREAM_GONE_S)
@@ -4139,7 +4172,10 @@ class RealtimeVoiceSession:
max(0.0, time.monotonic() - self._last_voiced_input_monotonic)
if self._last_voiced_input_monotonic
else 0.0,
- self._turn_pause_ms() / 1000.0,
+ # Unreachable with an automatic pause (a settled pause never
+ # reaches this hold), but the log must not be the thing that
+ # raises if that ever changes.
+ (self._turn_pause_ms() or 0) / 1000.0,
)
self._turn_pause_waiter = asyncio.create_task(
self._request_native_response_after_pause(turn_id),
diff --git a/jarvis/speech/pipeline.py b/jarvis/speech/pipeline.py
index d7bd54df64..a7af9af989 100644
--- a/jarvis/speech/pipeline.py
+++ b/jarvis/speech/pipeline.py
@@ -332,6 +332,32 @@ def _looks_like_long_composition(partial: str | None) -> bool:
return len(partial.split()) >= _LONG_COMPOSITION_MIN_WORDS
+#: The local endpointer's own window, used whenever the config asks for
+#: "automatic" (``speech.vad_silence_ms = 0``). A realtime transport resolves
+#: automatic to the PROVIDER's factory turn detection; a local VAD has no
+#: vendor to defer to, so it keeps the 1.5 s rule this pipeline shipped with.
+_LOCAL_SILENCE_WINDOW_DEFAULT_MS = 1500
+
+
+def _local_silence_window_ms(ms: int | None) -> int:
+ """Resolve a configured silence window for the LOCAL VAD.
+
+ 0 / None / a negative value all mean "automatic" and resolve to the
+ pipeline's own window; anything else is an explicit user choice and is
+ clamped to the config field's bounds so a typo cannot cut a talker off
+ between words.
+ """
+ try:
+ raw = int(ms) if ms is not None else 0
+ except (TypeError, ValueError):
+ # A non-numeric config value is a typo, not a fault: the built-in
+ # window keeps endpointing usable.
+ raw = 0
+ if raw <= 0:
+ return _LOCAL_SILENCE_WINDOW_DEFAULT_MS
+ return max(500, min(5000, raw))
+
+
def _should_extend_silence_for_composition(partial: str | None) -> bool:
"""Single entry point for the adaptive-patience decision: widen the silence
window when the user is composing a delegation OR any long / open-ended
@@ -2616,7 +2642,11 @@ class SpeechPipeline:
self._pending_context_flush_s = max(0.5, float(pending_context_flush_s))
self._pending_flush_task: asyncio.Task[None] | None = None
self._vad = SileroEndpointer(
- silence_ms=vad_silence_ms,
+ # 0 is the config's "automatic" setting: every voice engine keeps
+ # its own factory timing, and for a local VAD that IS this
+ # pipeline's built-in window — a local endpointer has no vendor
+ # default to inherit, so "automatic" resolves to the 1.5 s rule.
+ silence_ms=_local_silence_window_ms(vad_silence_ms),
# Hard-cap of one captured chunk. The old 2026-05-09 value of 8 s
# assumed a cap-hit DISPATCHED (so it "felt too long"), but a
# ``max_utterance`` cut now carry-merges (``FORCED_CUT_REASONS`` →
@@ -3231,7 +3261,7 @@ class SpeechPipeline:
vad = getattr(self, "_vad", None)
setter = getattr(vad, "set_silence_window_ms", None)
if callable(setter):
- setter(int(ms))
+ setter(_local_silence_window_ms(ms))
def set_tts_volume(self, volume: float) -> None:
"""Live-apply a new master TTS output volume (0.0–1.0) — no restart.
diff --git a/jarvis/ui/web/frontend/src/hooks/useSilenceWindow.ts b/jarvis/ui/web/frontend/src/hooks/useSilenceWindow.ts
index a2e7b6444c..cd12a999d2 100644
--- a/jarvis/ui/web/frontend/src/hooks/useSilenceWindow.ts
+++ b/jarvis/ui/web/frontend/src/hooks/useSilenceWindow.ts
@@ -4,14 +4,21 @@ import { useCallback, useEffect, useState } from "react";
export interface SilenceWindowConfig {
ms: number;
default: number;
+ /** 0 — the automatic setting, where every voice mode keeps its factory timing. */
min: number;
max: number;
+ /** Lowest value that is a real window rather than "automatic". */
+ manual_min: number;
+ /** True while the current value IS the automatic setting. */
+ automatic: boolean;
}
export interface SilenceWindowSaveResult {
ok: boolean;
ms: number;
default: number;
+ manual_min: number;
+ automatic: boolean;
persisted: boolean;
applied_live: boolean;
restart_required: boolean;
diff --git a/jarvis/ui/web/frontend/src/views/settings/SilenceWindowGroup.test.tsx b/jarvis/ui/web/frontend/src/views/settings/SilenceWindowGroup.test.tsx
index a0c1c92eec..bf5cbc5e4c 100644
--- a/jarvis/ui/web/frontend/src/views/settings/SilenceWindowGroup.test.tsx
+++ b/jarvis/ui/web/frontend/src/views/settings/SilenceWindowGroup.test.tsx
@@ -10,10 +10,33 @@ beforeEach(() => {
});
afterEach(() => vi.unstubAllGlobals());
-function mockGet(ms = 1500) {
+function mockGet(ms = 0) {
fetchMock.mockResolvedValueOnce({
ok: true,
- json: async () => ({ ms, default: 1500, min: 500, max: 5000 }),
+ json: async () => ({
+ ms,
+ default: 0,
+ min: 0,
+ max: 5000,
+ manual_min: 500,
+ automatic: ms === 0,
+ }),
+ });
+}
+
+function mockPut(ms: number) {
+ fetchMock.mockResolvedValueOnce({
+ ok: true,
+ json: async () => ({
+ ok: true,
+ ms,
+ default: 0,
+ manual_min: 500,
+ automatic: ms === 0,
+ persisted: true,
+ applied_live: true,
+ restart_required: false,
+ }),
});
}
@@ -27,15 +50,21 @@ describe("SilenceWindowGroup", () => {
expect(screen.getByText("1.5 s")).toBeTruthy();
});
+ it("labels the default as automatic rather than a duration", async () => {
+ // 0 is the shipped default: every voice engine keeps its factory timing,
+ // so the slider must not imply a 0.0 s window (maintainer 2026-08-23).
+ mockGet(0);
+ render(<SilenceWindowGroup />);
+ const slider = (await screen.findByRole("slider")) as HTMLInputElement;
+ expect(slider.value).toBe("0");
+ expect(screen.queryByText("0.0 s")).toBeNull();
+ // The word appears in the value badge and again in the caption below it.
+ expect(screen.getAllByText(/automat/i).length).toBeGreaterThan(0); // i18n-allow: multilingual label stem
+ });
+
it("sends one PUT on commit, not per tick", async () => {
mockGet(1500);
- fetchMock.mockResolvedValueOnce({
- ok: true,
- json: async () => ({
- ok: true, ms: 2500, default: 1500,
- persisted: true, applied_live: true, restart_required: false,
- }),
- });
+ mockPut(2500);
render(<SilenceWindowGroup />);
const slider = (await screen.findByRole("slider")) as HTMLInputElement;
// drag (onChange) updates the label but does not PUT yet
@@ -49,19 +78,30 @@ describe("SilenceWindowGroup", () => {
expect(JSON.parse(putCall[1].body)).toMatchObject({ ms: 2500 });
});
- it("reset commits 1500", async () => {
+ it("snaps the dead gap below the floor to the nearer end", async () => {
+ // Between automatic (0) and the lowest real window (500) there is nothing
+ // valid, so a drag through the gap must land on one side or the other —
+ // never on a value the backend would have to correct behind the user.
+ mockGet(1500);
+ mockPut(500);
+ render(<SilenceWindowGroup />);
+ const slider = (await screen.findByRole("slider")) as HTMLInputElement;
+ fireEvent.change(slider, { target: { value: "100" } });
+ expect(slider.value).toBe("0"); // nearer to automatic
+ fireEvent.change(slider, { target: { value: "400" } });
+ expect(slider.value).toBe("500"); // nearer to the floor
+ fireEvent.mouseUp(slider);
+ await waitFor(() => expect(fetchMock).toHaveBeenCalledTimes(2));
+ expect(JSON.parse(fetchMock.mock.calls[1][1].body)).toMatchObject({ ms: 500 });
+ });
+
+ it("reset commits the automatic default", async () => {
mockGet(3000);
- fetchMock.mockResolvedValueOnce({
- ok: true,
- json: async () => ({
- ok: true, ms: 1500, default: 1500,
- persisted: true, applied_live: true, restart_required: false,
- }),
- });
+ mockPut(0);
render(<SilenceWindowGroup />);
await screen.findByRole("slider");
fireEvent.click(screen.getByRole("button", { name: /reset|zurück|restablecer/i })); // i18n-allow: multilingual button-name regex
await waitFor(() => expect(fetchMock).toHaveBeenCalledTimes(2));
- expect(JSON.parse(fetchMock.mock.calls[1][1].body)).toMatchObject({ ms: 1500 });
+ expect(JSON.parse(fetchMock.mock.calls[1][1].body)).toMatchObject({ ms: 0 });
});
});
diff --git a/jarvis/ui/web/frontend/src/views/settings/SilenceWindowGroup.tsx b/jarvis/ui/web/frontend/src/views/settings/SilenceWindowGroup.tsx
index bdb9462b01..9f9f8ea388 100644
--- a/jarvis/ui/web/frontend/src/views/settings/SilenceWindowGroup.tsx
+++ b/jarvis/ui/web/frontend/src/views/settings/SilenceWindowGroup.tsx
@@ -4,17 +4,28 @@ import { useSilenceWindow } from "@/hooks/useSilenceWindow";
import { useEventStore } from "@/store/events";
import { useT } from "@/i18n";
+/** The automatic setting: every voice mode keeps its own factory timing. */
+const AUTOMATIC_MS = 0;
+/** Fallback for the lowest REAL window, until the GET brings the server's own. */
+const MANUAL_MIN_FALLBACK_MS = 500;
+
/**
* "Thinking pause" slider inside the Settings view. Tunes how long Jarvis
* waits in silence before it takes the user's turn — ONE value for both voice
* engines (maintainer directive 2026-08-18; the pipeline-only scope of
- * 2026-07-21 is history). Range 0.5–5.0 s, step 0.1 s, default 1.5 s. The
- * label tracks the slider live; the PUT fires on release (pointer/key up) so
- * a 0.1 s-step drag does not storm the backend. The change persists to
- * jarvis.toml and applies live to the classic pipeline; a realtime session
- * reads it on its next turn (a self-answering voice model bakes it into its
- * own turn detection at open, so there it lands on the next call). A headless
- * host falls back to "applies on next start".
+ * 2026-07-21 is history).
+ *
+ * The slider starts at AUTOMATIC (0, the default): no override is sent
+ * anywhere, so the classic pipeline uses its 1.5 s rule and a realtime
+ * provider ends the turn on its own factory timing — the shortest pause there
+ * is, and the one a caller gets from the vendor's own client (maintainer
+ * 2026-08-23). Above that the range is 0.5–5.0 s in 0.1 s steps; the dead gap
+ * between automatic and the floor snaps to whichever side is nearer, so a drag
+ * can always reach both. The label tracks the slider live; the PUT fires on
+ * release (pointer/key up) so a 0.1 s-step drag does not storm the backend.
+ * The change persists to jarvis.toml and applies live to the classic pipeline;
+ * a realtime session reads it when it opens, so there it lands on the next
+ * call. A headless host falls back to "applies on next start".
*/
export function SilenceWindowGroup() {
const t = useT();
@@ -23,11 +34,11 @@ export function SilenceWindowGroup() {
// Local slider value (ms). Mirrors the server value once GET resolves; the
// label follows it instantly on drag while the PUT waits for commit.
- const [ms, setLocalMs] = useState(1500);
+ const [ms, setLocalMs] = useState(AUTOMATIC_MS);
const [saving, setSaving] = useState(false);
// The last value we actually committed — guards against an idle mouseUp (no
// drag) firing a redundant PUT.
- const committedRef = useRef(1500);
+ const committedRef = useRef(AUTOMATIC_MS);
useEffect(() => {
if (config) {
@@ -36,7 +47,22 @@ export function SilenceWindowGroup() {
}
}, [config]);
- const seconds = (ms / 1000).toFixed(1);
+ const manualMin = config?.manual_min ?? MANUAL_MIN_FALLBACK_MS;
+ const defaultMs = config?.default ?? AUTOMATIC_MS;
+ const isAutomatic = ms <= AUTOMATIC_MS;
+
+ /** Snap the dead gap below the floor to the nearer end so both stay reachable. */
+ function snap(raw: number): number {
+ if (raw >= manualMin) return raw;
+ return raw > manualMin / 2 ? manualMin : AUTOMATIC_MS;
+ }
+
+ /** The slider's own wording for a value: "Automatic", or seconds. */
+ function describe(value: number): string {
+ return value <= AUTOMATIC_MS
+ ? t("settings_view.silence_window.automatic_label")
+ : `${(value / 1000).toFixed(1)} ${t("settings_view.silence_window.unit_seconds")}`;
+ }
async function commit(next: number) {
if (next === committedRef.current) return; // no change → no PUT
@@ -46,10 +72,9 @@ export function SilenceWindowGroup() {
const res = await setMs(next);
pushToast(
"success",
- t("settings_view.silence_window.saved_toast").replace(
- "{0}",
- `${(res.ms / 1000).toFixed(1)} ${t("settings_view.silence_window.unit_seconds")}`,
- ),
+ res.ms <= AUTOMATIC_MS
+ ? t("settings_view.silence_window.saved_toast_automatic")
+ : t("settings_view.silence_window.saved_toast").replace("{0}", describe(res.ms)),
);
if (res.restart_required) {
pushToast("warning", t("settings_view.silence_window.restart_caption"));
@@ -64,12 +89,11 @@ export function SilenceWindowGroup() {
}
function onReset() {
- const def = config?.default ?? 1500;
- setLocalMs(def);
- void commit(def);
+ setLocalMs(defaultMs);
+ void commit(defaultMs);
}
- const showReset = ms !== (config?.default ?? 1500);
+ const showReset = ms !== defaultMs;
return (
<div className="mt-2 rounded-lg border border-border bg-card/60 p-4">
@@ -80,9 +104,7 @@ export function SilenceWindowGroup() {
<h4 className="font-display text-sm font-semibold">
{t("settings_view.silence_window.title")}
</h4>
- <span className="font-mono text-sm text-primary">
- {`${seconds} ${t("settings_view.silence_window.unit_seconds")}`}
- </span>
+ <span className="font-mono text-sm text-primary">{describe(ms)}</span>
</div>
<p className="mt-1 text-xs text-muted-foreground">
{t("settings_view.silence_window.description")}
@@ -90,18 +112,24 @@ export function SilenceWindowGroup() {
<input
type="range"
- min={config?.min ?? 500}
+ min={config?.min ?? AUTOMATIC_MS}
max={config?.max ?? 5000}
step={100}
value={ms}
disabled={loading || saving}
- onChange={(e) => setLocalMs(Number(e.target.value))}
+ onChange={(e) => setLocalMs(snap(Number(e.target.value)))}
onMouseUp={() => void commit(ms)}
onKeyUp={() => void commit(ms)}
onTouchEnd={() => void commit(ms)}
className="mt-4 w-full accent-primary disabled:opacity-50"
/>
+ {isAutomatic && (
+ <p className="mt-2 text-[11px] text-muted-foreground">
+ {t("settings_view.silence_window.automatic_caption")}
+ </p>
+ )}
+
{showReset && (
<button
type="button"
diff --git a/jarvis/ui/web/settings_routes.py b/jarvis/ui/web/settings_routes.py
index aa6a81ff20..c1f1432125 100644
--- a/jarvis/ui/web/settings_routes.py
+++ b/jarvis/ui/web/settings_routes.py
@@ -3129,38 +3129,63 @@ async def put_wiki_provider(body: WikiProviderBody, request: Request) -> dict[st
# PUT to change. Persisted to jarvis.toml [speech].vad_silence_ms AND live-applied
# to the running SpeechPipeline (set_silence_window_ms → SileroEndpointer), so a
# change takes effect immediately without a restart; a headless/down pipeline
-# falls back to "applies on next start". Range 500–5000 ms, default 1500.
+# falls back to "applies on next start".
+#
+# 0 = AUTOMATIC and is the default: every voice engine keeps its own factory
+# turn detection — the local VAD its 1.5 s rule, a realtime provider whatever
+# its API does out of the box (no override is sent at all). A positive value
+# is an explicit patience override and lives in 500–5000 ms.
# ---------------------------------------------------------------------------
+_SILENCE_WINDOW_AUTOMATIC = 0
_SILENCE_WINDOW_MIN = 500
_SILENCE_WINDOW_MAX = 5000
-_SILENCE_WINDOW_DEFAULT = 1500
+_SILENCE_WINDOW_DEFAULT = _SILENCE_WINDOW_AUTOMATIC
+
+
+def _normalise_silence_window_ms(ms: int) -> int:
+ """0 stays automatic; anything positive lands inside the slider's bounds."""
+ raw = int(ms)
+ if raw <= 0:
+ return _SILENCE_WINDOW_AUTOMATIC
+ return max(_SILENCE_WINDOW_MIN, min(_SILENCE_WINDOW_MAX, raw))
class SilenceWindowBody(BaseModel):
- ms: int = Field(..., ge=_SILENCE_WINDOW_MIN, le=_SILENCE_WINDOW_MAX)
+ # 0 is accepted alongside the 500-5000 band: it is the automatic setting,
+ # not a 0 ms window. Values between the two are snapped up to the floor by
+ # the normaliser rather than rejected — the slider can only produce them
+ # while a drag passes through the gap.
+ ms: int = Field(..., ge=_SILENCE_WINDOW_AUTOMATIC, le=_SILENCE_WINDOW_MAX)
persist: bool = Field(default=True, description="Persist as boot default in jarvis.toml")
def _current_silence_window_ms(request: Request) -> int:
cfg = _config(request)
speech = getattr(cfg, "speech", None)
- return int(getattr(speech, "vad_silence_ms", _SILENCE_WINDOW_DEFAULT))
+ return _normalise_silence_window_ms(
+ int(getattr(speech, "vad_silence_ms", _SILENCE_WINDOW_DEFAULT))
+ )
@router.get("/silence-window")
async def get_silence_window(request: Request) -> dict[str, object]:
+ ms = _current_silence_window_ms(request)
return {
- "ms": _current_silence_window_ms(request),
+ "ms": ms,
"default": _SILENCE_WINDOW_DEFAULT,
- "min": _SILENCE_WINDOW_MIN,
+ "min": _SILENCE_WINDOW_AUTOMATIC,
"max": _SILENCE_WINDOW_MAX,
+ # The lowest value that is a real window rather than the automatic
+ # setting, so the slider knows where the gap it must skip ends.
+ "manual_min": _SILENCE_WINDOW_MIN,
+ "automatic": ms == _SILENCE_WINDOW_AUTOMATIC,
}
@router.put("/silence-window")
async def put_silence_window(body: SilenceWindowBody, request: Request) -> dict[str, object]:
- ms = int(body.ms) # already range-validated by the Pydantic Field
+ ms = _normalise_silence_window_ms(body.ms)
# Best-effort in-memory cfg update so a later cfg read agrees pre-restart.
cfg = _config(request)
@@ -3197,8 +3222,13 @@ async def put_silence_window(body: SilenceWindowBody, request: Request) -> dict[
"ok": True,
"ms": ms,
"default": _SILENCE_WINDOW_DEFAULT,
+ "manual_min": _SILENCE_WINDOW_MIN,
+ "automatic": ms == _SILENCE_WINDOW_AUTOMATIC,
"persisted": persisted,
"applied_live": applied_live,
+ # A realtime call reads the value when it opens, so the classic
+ # pipeline's live-apply is the only thing a restart could be needed
+ # for; an automatic setting needs nothing beyond the next turn.
"restart_required": not applied_live,
}
diff --git a/tests/integration/test_settings_silence_window.py b/tests/integration/test_settings_silence_window.py
index 989f16ca98..3721474149 100644
--- a/tests/integration/test_settings_silence_window.py
+++ b/tests/integration/test_settings_silence_window.py
@@ -44,7 +44,14 @@ def _no_toml_write(monkeypatch: pytest.MonkeyPatch) -> list[int]:
def test_get_returns_current_and_bounds(server: WebServer) -> None:
with TestClient(server.app) as client:
body = client.get("/api/settings/silence-window").json()
- assert body == {"ms": 1500, "default": 1500, "min": 500, "max": 5000}
+ assert body == {
+ "ms": 0,
+ "default": 0,
+ "min": 0,
+ "max": 5000,
+ "manual_min": 500,
+ "automatic": True,
+ }
def test_put_persists_and_applies_live(server: WebServer) -> None:
@@ -67,13 +74,34 @@ def test_put_out_of_range_is_rejected(server: WebServer) -> None:
# Body validation (Pydantic Field ge/le) → FastAPI 422; both 400 and 422
# are correct "rejected" semantics.
assert client.put(
- "/api/settings/silence-window", json={"ms": 100}
+ "/api/settings/silence-window", json={"ms": -1}
).status_code in (400, 422)
assert client.put(
"/api/settings/silence-window", json={"ms": 9000}
).status_code in (400, 422)
+def test_put_snaps_the_gap_below_the_floor_up(server: WebServer) -> None:
+ """100 ms is inside the dead gap a drag passes through, not a choice.
+
+ It snaps up to the lowest real window instead of being rejected, so a
+ slider release mid-gap can never fail the save.
+ """
+ with TestClient(server.app) as client:
+ body = client.put("/api/settings/silence-window", json={"ms": 100}).json()
+ assert body["ms"] == 500
+ assert body["automatic"] is False
+
+
+def test_put_automatic_is_accepted(server: WebServer) -> None:
+ """0 means "let every engine use its own factory timing" — a valid save."""
+ with TestClient(server.app) as client:
+ body = client.put("/api/settings/silence-window", json={"ms": 0}).json()
+ assert body["ms"] == 0
+ assert body["automatic"] is True
+ assert server.app.state.config.speech.vad_silence_ms == 0
+
+
def test_put_without_pipeline_reports_restart_required(server: WebServer) -> None:
with TestClient(server.app) as client:
body = client.put("/api/settings/silence-window", json={"ms": 1500}).json()
diff --git a/tests/unit/core/test_silence_window_config.py b/tests/unit/core/test_silence_window_config.py
index b974f35243..a9255bd682 100644
--- a/tests/unit/core/test_silence_window_config.py
+++ b/tests/unit/core/test_silence_window_config.py
@@ -7,30 +7,49 @@ from pydantic import ValidationError
from jarvis.core.config import SpeechConfig
-def test_default_is_1500_ms() -> None:
- assert SpeechConfig().vad_silence_ms == 1500
-
-
-def test_vad_constructor_default_matches_product_default() -> None:
- """Single source of truth: a bare ``SileroEndpointer()`` must fall back to the
- SAME silence window as the product default (1.5 s), never the pre-"1.5s rule"
- 1.0 s value. Every real caller passes the configured value explicitly, but
- keeping the constructor default aligned stops a stale 1.0 s from creeping back
- via any future bare construction (the maintainer's mandate: the default is
- 1.5 s everywhere; a single 1.0 s user setting stays a *user* choice)."""
+def test_default_is_automatic() -> None:
+ """0 = automatic: every voice engine keeps its own factory turn detection.
+
+ A fixed window layered on a realtime provider that already endpoints
+ natively made every finished sentence wait twice, and the extra wait was
+ audible against the vendor's own client (maintainer 2026-08-23). Patience
+ is now something a user asks for, not something the product assumes.
+ """
+ assert SpeechConfig().vad_silence_ms == 0
+
+
+def test_automatic_resolves_to_the_pipelines_own_window() -> None:
+ """A LOCAL VAD has no vendor default to inherit, so automatic = 1.5 s.
+
+ Single source of truth for that resolution: a bare ``SileroEndpointer()``
+ must fall back to the SAME window the pipeline resolves "automatic" to,
+ never the pre-"1.5s rule" 1.0 s value. Every real caller passes the
+ resolved value explicitly, but keeping the constructor default aligned
+ stops a stale 1.0 s from creeping back via a bare construction.
+ """
from jarvis.audio.vad import SileroEndpointer
+ from jarvis.speech.pipeline import _local_silence_window_ms
- default_ms = SpeechConfig().vad_silence_ms
- assert SileroEndpointer()._silence_frames == default_ms // 32
+ resolved = _local_silence_window_ms(SpeechConfig().vad_silence_ms)
+ assert resolved == 1500
+ assert SileroEndpointer()._silence_frames == resolved // 32
def test_accepts_in_range_value() -> None:
assert SpeechConfig(vad_silence_ms=2500).vad_silence_ms == 2500
-def test_rejects_below_minimum() -> None:
+def test_a_window_below_the_floor_is_raised_to_it() -> None:
+ """400 ms is not a patience setting — it would cut a talker off between
+ words — but a typo must never make the app unbootable, so it is raised to
+ the floor rather than rejected. Only 0 (automatic) lives below it."""
+ assert SpeechConfig(vad_silence_ms=400).vad_silence_ms == 500
+ assert SpeechConfig(vad_silence_ms=0).vad_silence_ms == 0
+
+
+def test_rejects_negative() -> None:
with pytest.raises(ValidationError):
- SpeechConfig(vad_silence_ms=400)
+ SpeechConfig(vad_silence_ms=-1)
def test_rejects_above_maximum() -> None:
@@ -60,3 +79,16 @@ def test_writer_clamps_out_of_range(tmp_path) -> None:
config_writer.set_silence_window_ms(99999, path=p)
data = tomllib.loads(p.read_text(encoding="utf-8"))
assert data["speech"]["vad_silence_ms"] == 5000
+
+
+def test_writer_keeps_automatic_as_zero(tmp_path) -> None:
+ """0 is the automatic setting, not a 0 ms window — it must survive the clamp."""
+ import tomllib
+
+ from jarvis.core import config_writer
+
+ p = tmp_path / "jarvis.toml"
+ p.write_text("", encoding="utf-8")
+ config_writer.set_silence_window_ms(0, path=p)
+ data = tomllib.loads(p.read_text(encoding="utf-8"))
+ assert data["speech"]["vad_silence_ms"] == 0
diff --git a/tests/unit/realtime/test_gemini_live.py b/tests/unit/realtime/test_gemini_live.py
index 522777f2dc..2f6b11fe59 100644
--- a/tests/unit/realtime/test_gemini_live.py
+++ b/tests/unit/realtime/test_gemini_live.py
@@ -624,7 +624,9 @@ async def test_thinking_pause_becomes_geminis_silence_window(
back once the turn is closed — so "wait for a clear pause before you take
the turn" (maintainer 2026-08-18) can only be Gemini's own silence window.
A user who resumes inside it continues the same activity: the words
- append, nothing is submitted twice. LOW sensitivity stays alongside.
+ append, nothing is submitted twice. LOW sensitivity travels alongside it —
+ the session sends both or neither, because the window without the patience
+ is the wait with none of the protection it was added for.
"""
from google.genai import types
@@ -632,7 +634,9 @@ async def test_thinking_pause_becomes_geminis_silence_window(
provider = GeminiLiveProvider(api_key="test-key")
session = await provider.open_session(
- RealtimeSessionConfig(voice="Puck", turn_pause_ms=1_500)
+ RealtimeSessionConfig(
+ voice="Puck", turn_pause_ms=1_500, end_of_speech_sensitivity="low"
+ )
)
_selected, config = holder["client"].aio.live.connect_calls[0]
detection = config.realtime_input_config.automatic_activity_detection
@@ -661,27 +665,24 @@ async def test_explicit_silence_window_outranks_the_thinking_pause(
@pytest.mark.asyncio
-async def test_default_config_asks_gemini_to_sit_through_a_pause(
+async def test_default_config_sends_no_turn_detection_at_all(
monkeypatch: pytest.MonkeyPatch,
) -> None:
- """Without a configured pause the session is patient, not fixed-windowed.
-
- Live 2026-08-13 16:46/16:47: Gemini's own default read a mid-sentence
- pause as end-of-turn and a coding pane was briefed with a quarter of the
- sentence. LOW fixes that; with no ``turn_pause_ms`` and no explicit
- override, silence_duration_ms stays unset (the provider's own timing).
+ """The default session leaves Gemini's factory turn detection alone.
+
+ Nothing is sent — no window, no sensitivity, no activity-detection block
+ — so the turn ends exactly when Gemini decides it does, which is the
+ latency a caller gets straight from the vendor's API. A 1.5 s window
+ layered on top of native endpointing made every finished sentence wait
+ audibly longer than the vendor's own client (maintainer 2026-08-23); the
+ patience of 2026-08-13 is now an explicit opt-in, not the default.
"""
- from google.genai import types
-
holder = _patch_genai_client(monkeypatch)
provider = GeminiLiveProvider(api_key="test-key")
session = await provider.open_session(RealtimeSessionConfig(voice="Puck"))
_selected, config = holder["client"].aio.live.connect_calls[0]
- detection = config.realtime_input_config.automatic_activity_detection
- assert detection.end_of_speech_sensitivity == types.EndSensitivity.END_SENSITIVITY_LOW
- assert detection.silence_duration_ms is None
- assert detection.disabled is False
+ assert config.realtime_input_config is None
await session.close()
diff --git a/tests/unit/realtime/test_thinking_pause.py b/tests/unit/realtime/test_thinking_pause.py
index 3249dec565..baa63a5f78 100644
--- a/tests/unit/realtime/test_thinking_pause.py
+++ b/tests/unit/realtime/test_thinking_pause.py
@@ -179,14 +179,58 @@ async def test_pause_reaches_every_provider_family_as_turn_pause_ms():
await session.end(reason="test")
+async def test_automatic_sends_no_turn_detection_to_the_provider():
+ """The default (0 = automatic) leaves the provider's factory timing alone.
+
+ Neither the window nor the end-of-speech patience travels, so a transport
+ that endpoints natively answers on exactly the boundary its own API ships
+ with. A window layered on top of that detection made every finished
+ sentence wait audibly longer than the vendor's own client (maintainer
+ 2026-08-23) — the patience of 2026-08-18 is now an opt-in.
+ """
+ provider = _Provider("factory-timing")
+ session = _build(provider, pause_ms=0, session_id="automatic-pause")
+
+ await session.handle_control({"type": "audio_start", "sample_rate": 16_000})
+ try:
+ assert provider.opened_with.turn_pause_ms is None
+ assert provider.opened_with.silence_duration_ms is None
+ assert provider.opened_with.end_of_speech_sensitivity is None
+ finally:
+ await session.end(reason="test")
+
+
+async def test_an_explicit_pause_carries_its_patience_with_it():
+ """Opting into a window opts into the sensitivity that protects it.
+
+ Half the intent is the worst outcome: the wait without the protection it
+ was added for (a mid-sentence pause read as end-of-turn, live 2026-08-13).
+ """
+ provider = _Provider("patient")
+ session = _build(provider, pause_ms=2_500, session_id="explicit-pause")
+
+ await session.handle_control({"type": "audio_start", "sample_rate": 16_000})
+ try:
+ assert provider.opened_with.turn_pause_ms == 2_500
+ assert provider.opened_with.end_of_speech_sensitivity == "low"
+ finally:
+ await session.end(reason="test")
+
+
def test_pause_is_clamped_to_the_settings_bounds():
session = _build(_Provider("p"), pause_ms=99_999, session_id="clamp-high")
assert session._turn_pause_ms() == session_module._TURN_PAUSE_MAX_MS
session = _build(_Provider("p"), pause_ms=1, session_id="clamp-low")
assert session._turn_pause_ms() == session_module._TURN_PAUSE_MIN_MS
+ # No speech config at all, and an explicit zero, both mean AUTOMATIC: the
+ # provider's own turn detection decides and nothing is layered on top.
session = _build(_Provider("p"), pause_ms=1_500, session_id="clamp-none")
session._config = SimpleNamespace(brain=SimpleNamespace(reply_language="en"))
- assert session._turn_pause_ms() == session_module._TURN_PAUSE_DEFAULT_MS
+ assert session._turn_pause_ms() is None
+ session = _build(_Provider("p"), pause_ms=0, session_id="clamp-auto")
+ assert session._turn_pause_ms() is None
@pytest.mark.asyncio