diff --git a/apps/macos/Sources/Clawdis/GatewayProcessManager.swift b/apps/macos/Sources/Clawdis/GatewayProcessManager.swift index 44c7984c8..2196f0aed 100644 --- a/apps/macos/Sources/Clawdis/GatewayProcessManager.swift +++ b/apps/macos/Sources/Clawdis/GatewayProcessManager.swift @@ -206,6 +206,10 @@ final class GatewayProcessManager: ObservableObject { } } + func clearLog() { + self.log = "" + } + private func makeEnvironment() -> Environment { let merged = CommandResolver.preferredPaths().joined(separator: ":") return .inherit.updating([ diff --git a/apps/macos/Sources/Clawdis/VoicePushToTalk.swift b/apps/macos/Sources/Clawdis/VoicePushToTalk.swift index 5a052b995..8eaf85e3b 100644 --- a/apps/macos/Sources/Clawdis/VoicePushToTalk.swift +++ b/apps/macos/Sources/Clawdis/VoicePushToTalk.swift @@ -164,7 +164,13 @@ actor VoicePushToTalk { self.audioEngine.inputNode.removeTap(onBus: 0) self.audioEngine.stop() - // Give Speech a brief window to deliver the final result; otherwise fall back to current text. + // If we captured nothing, dismiss immediately when the user lets go. + if self.committed.isEmpty, self.volatile.isEmpty, self.adoptedPrefix.isEmpty { + await self.finalize(transcriptOverride: "", reason: "emptyOnRelease", sessionID: sessionID) + return + } + + // Otherwise, give Speech a brief window to deliver the final result; then fall back. self.timeoutTask?.cancel() self.timeoutTask = Task { [weak self] in try? await Task.sleep(nanoseconds: 1_500_000_000) // 1.5s grace period to await final result