From 41f50dedec0f44b4fcdd3439968dde0d40e81707 Mon Sep 17 00:00:00 2001 From: Developer Date: Wed, 8 Apr 2026 09:12:17 -0700 Subject: [PATCH] Fix cloud sidecar crash on first launch The cloud sidecar excludes the local Whisper engine module, but on first launch the config defaults to remote.mode="local" which tries to import it. Now catches the ImportError gracefully and shows an error message telling the user to switch to Cloud (Deepgram) mode in Settings. The API server still starts so Settings is accessible. Co-Authored-By: Claude Opus 4.6 (1M context) --- backend/app_controller.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/backend/app_controller.py b/backend/app_controller.py index 587c049..84ee02f 100644 --- a/backend/app_controller.py +++ b/backend/app_controller.py @@ -300,8 +300,17 @@ class AppController: # Lazy-import heavy local transcription dependencies global RealtimeTranscriptionEngine if RealtimeTranscriptionEngine is None: - from client.transcription_engine_realtime import RealtimeTranscriptionEngine as _RTE - RealtimeTranscriptionEngine = _RTE + try: + from client.transcription_engine_realtime import RealtimeTranscriptionEngine as _RTE + RealtimeTranscriptionEngine = _RTE + except ImportError: + # Cloud-only sidecar -- local engine not available + self._set_state( + AppState.ERROR, + "Local transcription not available in this build. " + "Please switch to Cloud (Deepgram) mode in Settings." + ) + return if self.device_manager: self.device_manager.set_device(device_config)