feat: Display Whisper model status in frontend and add debug logging
- Add activeWhisperConfig tracking in main.js to expose current Whisper settings - Expand get-sidecar-status IPC handler to return whisper config (model, device, compute, configSource) - Add Whisper status display in meeting-detail.html transcript panel header - Status updates every 5 seconds and shows: model, device, compute type, and ready state - Add comprehensive debug logging for config loading and whisper config resolution - Helps diagnose why config.json settings may not be passed correctly to sidecar 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -9,6 +9,7 @@ let sidecarProcess;
|
||||
let sidecarReady = false;
|
||||
let streamingActive = false;
|
||||
let appConfig = null;
|
||||
let activeWhisperConfig = null;
|
||||
|
||||
/**
|
||||
* Load configuration from external config.json
|
||||
@@ -17,6 +18,11 @@ let appConfig = null;
|
||||
* - Packaged: <app>/resources/config.json
|
||||
*/
|
||||
function loadConfig() {
|
||||
console.log("=== Config Loading Debug ===");
|
||||
console.log("app.isPackaged:", app.isPackaged);
|
||||
console.log("process.resourcesPath:", process.resourcesPath);
|
||||
console.log("__dirname:", __dirname);
|
||||
|
||||
const configPaths = [
|
||||
// Packaged app: resources folder
|
||||
app.isPackaged ? path.join(process.resourcesPath, "config.json") : null,
|
||||
@@ -26,13 +32,18 @@ function loadConfig() {
|
||||
path.join(__dirname, "config.json"),
|
||||
].filter(Boolean);
|
||||
|
||||
console.log("Config search paths:", configPaths);
|
||||
|
||||
for (const configPath of configPaths) {
|
||||
const exists = fs.existsSync(configPath);
|
||||
console.log(`Checking: ${configPath} - exists: ${exists}`);
|
||||
try {
|
||||
if (fs.existsSync(configPath)) {
|
||||
if (exists) {
|
||||
const configData = fs.readFileSync(configPath, "utf-8");
|
||||
appConfig = JSON.parse(configData);
|
||||
console.log("Config loaded from:", configPath);
|
||||
console.log("Config:", appConfig);
|
||||
console.log("Config content:", JSON.stringify(appConfig, null, 2));
|
||||
console.log("Whisper config:", appConfig.whisper);
|
||||
return appConfig;
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -51,7 +62,8 @@ function loadConfig() {
|
||||
compute: "int8"
|
||||
}
|
||||
};
|
||||
console.log("Using default config:", appConfig);
|
||||
console.log("WARNING: No config.json found, using defaults");
|
||||
console.log("Default config:", JSON.stringify(appConfig, null, 2));
|
||||
return appConfig;
|
||||
}
|
||||
|
||||
@@ -125,7 +137,15 @@ function startSidecar() {
|
||||
|
||||
try {
|
||||
// Get Whisper configuration from config.json or environment variables
|
||||
console.log("=== Whisper Config Resolution ===");
|
||||
console.log("appConfig:", appConfig);
|
||||
console.log("appConfig?.whisper:", appConfig?.whisper);
|
||||
|
||||
const whisperConfig = appConfig?.whisper || {};
|
||||
console.log("whisperConfig (resolved):", whisperConfig);
|
||||
console.log("process.env.WHISPER_MODEL:", process.env.WHISPER_MODEL);
|
||||
console.log("whisperConfig.model:", whisperConfig.model);
|
||||
|
||||
const whisperEnv = {
|
||||
...process.env,
|
||||
WHISPER_MODEL: process.env.WHISPER_MODEL || whisperConfig.model || "medium",
|
||||
@@ -133,12 +153,20 @@ function startSidecar() {
|
||||
WHISPER_COMPUTE: process.env.WHISPER_COMPUTE || whisperConfig.compute || "int8",
|
||||
};
|
||||
|
||||
console.log("Starting sidecar with:", sidecarExecutable, sidecarArgs.join(" "));
|
||||
console.log("Whisper config:", {
|
||||
// Store the active whisper config for status reporting
|
||||
activeWhisperConfig = {
|
||||
model: whisperEnv.WHISPER_MODEL,
|
||||
device: whisperEnv.WHISPER_DEVICE,
|
||||
compute: whisperEnv.WHISPER_COMPUTE,
|
||||
});
|
||||
configSource: appConfig?.whisper ? "config.json" : "defaults"
|
||||
};
|
||||
|
||||
console.log("=== Final Whisper Environment ===");
|
||||
console.log("WHISPER_MODEL:", whisperEnv.WHISPER_MODEL);
|
||||
console.log("WHISPER_DEVICE:", whisperEnv.WHISPER_DEVICE);
|
||||
console.log("WHISPER_COMPUTE:", whisperEnv.WHISPER_COMPUTE);
|
||||
console.log("Starting sidecar with:", sidecarExecutable, sidecarArgs.join(" "));
|
||||
console.log("Active Whisper config:", activeWhisperConfig);
|
||||
|
||||
sidecarProcess = spawn(sidecarExecutable, sidecarArgs, {
|
||||
cwd: sidecarDir,
|
||||
@@ -239,7 +267,11 @@ ipcMain.handle("navigate", (event, page) => {
|
||||
});
|
||||
|
||||
ipcMain.handle("get-sidecar-status", () => {
|
||||
return { ready: sidecarReady, streaming: streamingActive };
|
||||
return {
|
||||
ready: sidecarReady,
|
||||
streaming: streamingActive,
|
||||
whisper: activeWhisperConfig
|
||||
};
|
||||
});
|
||||
|
||||
// === Streaming Mode IPC Handlers ===
|
||||
|
||||
Reference in New Issue
Block a user