From 8e8da17ad9b6b391cd38b7b38af4a7d0800d4b98 Mon Sep 17 00:00:00 2001 From: oxoxDev <164490987+oxoxDev@users.noreply.github.com> Date: Fri, 10 Apr 2026 20:17:05 +0530 Subject: [PATCH] fix(voice): cross-platform microphone permission handling (#489) (#491) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(voice): add cross-platform microphone permission handling (#489) Voice dictation in release DMG silently fails because the macOS hardened runtime enforces entitlements and the sidecar plist lacked the audio-input entitlement. This adds the entitlement, NSMicrophoneUsageDescription for the system permission prompt, and cross-platform microphone permission detection (CPAL device probe) with clear error messages on macOS, Windows, and Linux. Co-Authored-By: Claude Opus 4.6 * fix(permissions): use plist file for infoPlist and fix cross-platform warnings (#489) - infoPlist expects a file path, not inline JSON — create Info.plist with NSMicrophoneUsageDescription and reference it as a string - Move Microphone permission request out of macOS-only cfg block since request_microphone_access() is cross-platform (fixes unused import warning on Linux CI) - Treat persistent Unknown mic permission as Denied per CodeRabbit review Co-Authored-By: Claude Opus 4.6 --------- Co-authored-by: Claude Opus 4.6 Co-authored-by: Cyrus Gray <144336577+graycyrus@users.noreply.github.com> --- app/src-tauri/Info.plist | 8 ++ app/src-tauri/entitlements.sidecar.plist | 1 + app/src-tauri/tauri.conf.json | 1 + src/openhuman/accessibility/mod.rs | 5 +- src/openhuman/accessibility/permissions.rs | 122 ++++++++++++++++++++ src/openhuman/accessibility/types.rs | 2 + src/openhuman/screen_intelligence/engine.rs | 39 ++++--- src/openhuman/screen_intelligence/state.rs | 1 + src/openhuman/voice/audio_capture.rs | 32 +++++ 9 files changed, 194 insertions(+), 17 deletions(-) create mode 100644 app/src-tauri/Info.plist diff --git a/app/src-tauri/Info.plist b/app/src-tauri/Info.plist new file mode 100644 index 000000000..b94041d4a --- /dev/null +++ b/app/src-tauri/Info.plist @@ -0,0 +1,8 @@ + + + + + NSMicrophoneUsageDescription + OpenHuman uses the microphone for voice dictation — press the hotkey to record speech and transcribe it to text. + + diff --git a/app/src-tauri/entitlements.sidecar.plist b/app/src-tauri/entitlements.sidecar.plist index 92a9edf6d..08b7e88ec 100644 --- a/app/src-tauri/entitlements.sidecar.plist +++ b/app/src-tauri/entitlements.sidecar.plist @@ -8,6 +8,7 @@ com.apple.security.cs.disable-library-validation + com.apple.security.device.audio-input