Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.
JavaScript aianthropiccross-platformgeminigroqlinuxmacosnvidiaopen-sourceopenaiparakeetspeech-to-texttranscribewhisperwindows
fix(whisper): accept any casing for the GPU opt-out flag
Gabriel Stein28bf6f44583b
diff --git a/src/helpers/ipcHandlers.js b/src/helpers/ipcHandlers.jsindex b9e73de24..055e8dfab 100644--- a/src/helpers/ipcHandlers.js+++ b/src/helpers/ipcHandlers.js@@ -1112,7 +1112,7 @@ class IPCHandlers {this.environmentManager.saveAllKeysToEnvFile().catch((err) => {debugLogger.error("Failed to persist startup env vars to .env", {set: Object.keys(setVars),- cleared: clearVars,+ clearRequested: clearVars,error: err.message,});});diff --git a/src/helpers/whisper.js b/src/helpers/whisper.jsindex 283dc0999..b4869215c 100644--- a/src/helpers/whisper.js+++ b/src/helpers/whisper.js@@ -79,7 +79,8 @@ class WhisperManager {// env + installed packs, so enabling or removing a pack applies immediately// instead of after an app restart. A pack on disk implies intent: the user// downloaded it, so it engages unless WHISPER_*_ENABLED is explicitly set to- // "false" (an opt-out that survives without deleting the pack). Requiring+ // "false" (case-insensitive; an opt-out that survives without deleting the+ // pack). Requiring// the flag to be present stranded downloaded packs on silent CPU whenever// the .env line was lost (#1340). WHISPER_GPU_FAILED lists backends that// crashed on this machine (persisted by ipcHandlers when the server falls@@ -89,12 +90,12 @@ class WhisperManager {resolveGpuStartOptions() {const failed = resolveFailedGpuBackends(process.env.WHISPER_GPU_FAILED);const useCuda =- process.env.WHISPER_CUDA_ENABLED !== "false" &&+ (process.env.WHISPER_CUDA_ENABLED || "").toLowerCase() !== "false" &&!failed.includes("cuda") &&!!this._cudaBinaryManager?.isDownloaded();const useVulkan =!useCuda &&- process.env.WHISPER_VULKAN_ENABLED !== "false" &&+ (process.env.WHISPER_VULKAN_ENABLED || "").toLowerCase() !== "false" &&!failed.includes("vulkan") &&!!this._vulkanBinaryManager?.isDownloaded();return { useCuda, useVulkan };diff --git a/test/helpers/whisperGpuResolve.test.js b/test/helpers/whisperGpuResolve.test.jsindex 8cacc84d9..8d40f3adf 100644--- a/test/helpers/whisperGpuResolve.test.js+++ b/test/helpers/whisperGpuResolve.test.js@@ -100,6 +100,17 @@ test("explicit 'false' opts a downloaded pack out", () => {assert.deepEqual(cudaOnly.resolveGpuStartOptions(), { useCuda: false, useVulkan: false });});+test("the 'false' opt-out is case-insensitive (hand-edited .env)", () => {+ // The flag is a hand-edit surface now, so FALSE/False must opt out too.+ process.env.WHISPER_VULKAN_ENABLED = "FALSE";+ const vulkanOnly = managerWith({ vulkanDownloaded: true });+ assert.deepEqual(vulkanOnly.resolveGpuStartOptions(), { useCuda: false, useVulkan: false });++ process.env.WHISPER_CUDA_ENABLED = "False";+ const cudaOnly = managerWith({ cudaDownloaded: true });+ assert.deepEqual(cudaOnly.resolveGpuStartOptions(), { useCuda: false, useVulkan: false });+});+test("a remembered failure still gates a flag-less downloaded pack", () => {process.env.WHISPER_GPU_FAILED = "vulkan";const manager = managerWith({ vulkanDownloaded: true });