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) <noreply@anthropic.com>
This commit is contained in:
@@ -300,8 +300,17 @@ class AppController:
|
|||||||
# Lazy-import heavy local transcription dependencies
|
# Lazy-import heavy local transcription dependencies
|
||||||
global RealtimeTranscriptionEngine
|
global RealtimeTranscriptionEngine
|
||||||
if RealtimeTranscriptionEngine is None:
|
if RealtimeTranscriptionEngine is None:
|
||||||
from client.transcription_engine_realtime import RealtimeTranscriptionEngine as _RTE
|
try:
|
||||||
RealtimeTranscriptionEngine = _RTE
|
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:
|
if self.device_manager:
|
||||||
self.device_manager.set_device(device_config)
|
self.device_manager.set_device(device_config)
|
||||||
|
|||||||
Reference in New Issue
Block a user