From c05fdad8e46301d28900417a07ce7fb9c6154342 Mon Sep 17 00:00:00 2001 From: egg Date: Thu, 18 Dec 2025 11:46:51 +0800 Subject: [PATCH] fix: Improve Whisper model status error handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- client/src/main.js | 12 +++++++++--- client/src/pages/meeting-detail.html | 15 +++++++++++---- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/client/src/main.js b/client/src/main.js index 929f281..e161461 100644 --- a/client/src/main.js +++ b/client/src/main.js @@ -434,9 +434,15 @@ function startSidecar() { mainWindow.webContents.send("model-download-progress", msg); } - // Forward model error status - if (msg.status === "model_error" && mainWindow) { - mainWindow.webContents.send("model-download-progress", msg); + // 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); diff --git a/client/src/pages/meeting-detail.html b/client/src/pages/meeting-detail.html index ab1a75d..e600fa4 100644 --- a/client/src/pages/meeting-detail.html +++ b/client/src/pages/meeting-detail.html @@ -289,10 +289,17 @@ try { const status = await window.electronAPI.getSidecarStatus(); if (status.whisper) { - 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'; + // 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';