From d9d0be02567080ed85843aa9a29eaef549d1ae2e Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 8 Dec 2025 16:52:13 +0100 Subject: [PATCH] fix: finalize only after full 1s silence --- apps/macos/Sources/Clawdis/VoiceWakeRuntime.swift | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/apps/macos/Sources/Clawdis/VoiceWakeRuntime.swift b/apps/macos/Sources/Clawdis/VoiceWakeRuntime.swift index 616d2d19a..b2808f9f6 100644 --- a/apps/macos/Sources/Clawdis/VoiceWakeRuntime.swift +++ b/apps/macos/Sources/Clawdis/VoiceWakeRuntime.swift @@ -224,7 +224,6 @@ actor VoiceWakeRuntime { private func monitorCapture(config: RuntimeConfig) async { let start = self.captureStartedAt ?? Date() let hardStop = start.addingTimeInterval(self.captureHardStop) - var silentStrikes = 0 while self.isCapturing { let now = Date() @@ -234,13 +233,8 @@ actor VoiceWakeRuntime { } if let last = self.lastHeard, now.timeIntervalSince(last) >= self.silenceWindow { - silentStrikes += 1 - if silentStrikes >= 2 { - await self.finalizeCapture(config: config) - return - } - } else { - silentStrikes = 0 + await self.finalizeCapture(config: config) + return } try? await Task.sleep(nanoseconds: 200_000_000)