fix: Improve Whisper model status error handling
- Set sidecarReady to false when model_error is received - Store error message in activeWhisperConfig for status display - Update frontend to show error state with red indicator - Prevents showing ✅ when model failed to load 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -434,10 +434,16 @@ function startSidecar() {
|
||||
mainWindow.webContents.send("model-download-progress", msg);
|
||||
}
|
||||
|
||||
// Forward model error status
|
||||
if (msg.status === "model_error" && mainWindow) {
|
||||
// Forward model error status and mark sidecar as not ready
|
||||
if (msg.status === "model_error") {
|
||||
sidecarReady = false;
|
||||
if (activeWhisperConfig) {
|
||||
activeWhisperConfig.error = msg.error || "Model load failed";
|
||||
}
|
||||
if (mainWindow) {
|
||||
mainWindow.webContents.send("model-download-progress", msg);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.log("Sidecar output:", line);
|
||||
}
|
||||
|
||||
@@ -289,10 +289,17 @@
|
||||
try {
|
||||
const status = await window.electronAPI.getSidecarStatus();
|
||||
if (status.whisper) {
|
||||
// Check if there was an error loading the model
|
||||
if (status.whisper.error) {
|
||||
whisperStatusEl.textContent = `❌ Model error: ${status.whisper.error}`;
|
||||
whisperStatusEl.style.color = '#dc3545';
|
||||
whisperStatusEl.title = 'Model failed to load';
|
||||
} else {
|
||||
const readyIcon = status.ready ? '✅' : '⏳';
|
||||
whisperStatusEl.textContent = `${readyIcon} Model: ${status.whisper.model} | Device: ${status.whisper.device} | Compute: ${status.whisper.compute}`;
|
||||
whisperStatusEl.title = `Config source: ${status.whisper.configSource || 'unknown'}`;
|
||||
whisperStatusEl.style.color = status.ready ? '#28a745' : '#ffc107';
|
||||
}
|
||||
} else {
|
||||
whisperStatusEl.textContent = status.ready ? '✅ Ready' : '⏳ Loading...';
|
||||
whisperStatusEl.style.color = status.ready ? '#28a745' : '#ffc107';
|
||||
|
||||
Reference in New Issue
Block a user