Skip to content

macOS: prevent Voice Wake crash when no input device is available#17948

Closed
agisilaos wants to merge 3 commits intoopenclaw:mainfrom
agisilaos:fix/macos-voicewake-no-mic-crash
Closed

macOS: prevent Voice Wake crash when no input device is available#17948
agisilaos wants to merge 3 commits intoopenclaw:mainfrom
agisilaos:fix/macos-voicewake-no-mic-crash

Conversation

@agisilaos
Copy link

@agisilaos agisilaos commented Feb 16, 2026

Summary

  • prevent macOS app crash when Voice Wake starts without a usable default audio input device
  • add CoreAudio preflight for default input availability before installing AVAudioEngine tap
  • keep failure in the recoverable runtime path (log + stop), avoiding SIGABRT process termination

Bug

On Macs with no usable input device (common on Mac mini/headless setups), enabling Voice Wake can crash:

  • AVAudioNode.installTapOnBus throws Objective-C exception
  • exception crosses into Swift runtime and aborts the app (SIGABRT)

Root Cause

VoiceWakeRuntime.start(with:) proceeded to installTap without verifying that the default input device is both present and input-capable/alive.

Changes

  1. AudioInputDeviceObserver
  • added hasUsableDefaultInputDevice()
  • added inputAvailabilitySummary() for diagnostics
  • added private helper for default UID vs alive input UID matching
  1. VoiceWakeRuntime.start(with:)
  • added startup guard using AudioInputDeviceObserver.hasUsableDefaultInputDevice() before installing tap
  • throws normal NSError (with input summary) and exits via existing catch/stop flow
  1. Tests
  • added AudioInputDeviceObserverTests covering:
    • missing default UID
    • default UID not alive/input-capable
    • default UID valid/alive

Validation

  • swift test --filter AudioInputDeviceObserverTests
  • swift test --filter VoiceWakeRuntimeTests

Fixes

@openclaw-barnacle openclaw-barnacle bot added app: macos App: macos size: S gateway Gateway runtime cli CLI command changes labels Feb 16, 2026
@agisilaos agisilaos changed the title macOS: prevent Voice Wake startup crash when no default input device is available macOS daemon: let gateway start bootstrap unloaded LaunchAgent Feb 16, 2026
@openclaw-barnacle openclaw-barnacle bot added size: M size: S and removed size: S gateway Gateway runtime cli CLI command changes size: M labels Feb 16, 2026
@agisilaos agisilaos changed the title macOS daemon: let gateway start bootstrap unloaded LaunchAgent macOS: prevent Voice Wake crash when no input device is available Feb 16, 2026
@agisilaos agisilaos force-pushed the fix/macos-voicewake-no-mic-crash branch from c43c040 to 050b74e Compare February 16, 2026 16:41
@agisilaos agisilaos closed this Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment