macOS: prevent Voice Wake crash when no input device is available#18235
Closed
agisilaos wants to merge 2 commits intoopenclaw:mainfrom
Closed
macOS: prevent Voice Wake crash when no input device is available#18235agisilaos wants to merge 2 commits intoopenclaw:mainfrom
agisilaos wants to merge 2 commits intoopenclaw:mainfrom
Conversation
|
This pull request has been automatically marked as stale due to inactivity. |
Contributor
|
Closing as AI-assisted stale-fix triage. Linked issue #12169 ("Mac app: SIGABRT crash when no audio input device available (voice wake)") is currently closed and was closed on 2026-02-23T04:32:59Z with state reason not_planned. If the underlying bug is still reproducible on current main, please reopen this PR (or open a new focused fix PR) and reference both #12169 and #18235 for fast re-triage. |
18 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bug
On Macs with no usable input device (common on Mac mini/headless setups), enabling Voice Wake can crash:
AVAudioNode.installTapOnBusthrows Objective-C exceptionSIGABRT)Root Cause
VoiceWakeRuntime.start(with:)proceeded toinstallTapwithout verifying that the default input device is both present and input-capable/alive.Changes
AudioInputDeviceObserverhasUsableDefaultInputDevice()inputAvailabilitySummary()for diagnosticsVoiceWakeRuntime.start(with:)AudioInputDeviceObserver.hasUsableDefaultInputDevice()before installing tapNSError(with input summary) and exits via existing catch/stop flowAudioInputDeviceObserverTestscovering:Validation
swift test --filter AudioInputDeviceObserverTestsswift test --filter VoiceWakeRuntimeTestsFixes
Greptile Summary
Prevents a crash (
SIGABRT) on Macs without a usable audio input device (e.g., Mac mini/headless setups) by adding a CoreAudio preflight check before installing theAVAudioEnginetap inVoiceWakeRuntime.start(with:). The newAudioInputDeviceObserver.hasUsableDefaultInputDevice()method verifies the default input device UID is both present and alive before proceeding, converting what was a fatal ObjC exception into a recoverable error handled through the existing catch/stop flow.AudioInputDeviceObservergainshasUsableDefaultInputDevice()andinputAvailabilitySummary()with a clean private helper that matches the default device UID against alive input UIDsVoiceWakeRuntime.start(with:)now guards on input device availability before engine creation, throwing a descriptiveNSErrorthat the existingcatchblock handles gracefullyAudioInputDeviceObserverTestscover nil UID, mismatched UID, and valid UID cases via a#if DEBUGtest hookVoiceWakeTesterandMicLevelMonitorhave similarinstallTappatterns without this preflight guard — they may benefit from the same protection in a follow-up, though they are less critical since they are user-initiated rather than automaticConfidence Score: 5/5
hasUsableDefaultInputDevice()guard toVoiceWakeTester.swiftandMicLevelMonitor.swiftin a follow-up.Last reviewed commit: 680ec7d
(5/5) You can turn off certain types of comments like style here!