From 0079f2a875e21fd536d61ca89891e21cdbc0177a Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Sat, 9 May 2026 21:37:38 +0700 Subject: [PATCH] test(app): don't crash playwright global-setup when speech creds missing Fork PRs (e.g. #845) run without OPENAI_API_KEY and without local speech models, so global-setup.ts:420 threw and blew up the entire Playwright job before any test could run. Soften the gate: when neither path is available, warn and run with dictation/voice disabled. Daemon already honors PASEO_DICTATION_ENABLED=0 and PASEO_VOICE_MODE_ENABLED=0. No spec currently exercises dictation, so nothing else needs to change; future dictation tests should gate on PASEO_DICTATION_ENABLED. --- packages/app/e2e/global-setup.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/app/e2e/global-setup.ts b/packages/app/e2e/global-setup.ts index b36c57d2e..146416f9b 100644 --- a/packages/app/e2e/global-setup.ts +++ b/packages/app/e2e/global-setup.ts @@ -414,15 +414,19 @@ async function resolveDictationConfig(): Promise { ); const hasDefaultLocalModelsDir = defaultLocalModelsDir.trim().length > 0 && existsSync(defaultLocalModelsDir); - const dictationProvider = openAiUsable ? "openai" : "local"; - if (dictationProvider === "local" && !hasDefaultLocalModelsDir) { - throw new Error( - "OpenAI key is not usable and local speech models are unavailable at ~/.paseo/models/local-speech. " + - "Either provide a valid OPENAI_API_KEY or install local speech models before running app e2e tests.", + // Fork PRs run without secrets and usually without local models. Don't crash + // the whole Playwright run — disable dictation/voice and let tests that need + // them gate on PASEO_DICTATION_ENABLED. + if (!openAiUsable && !hasDefaultLocalModelsDir) { + console.warn( + "[e2e] Neither OPENAI_API_KEY nor local speech models found — running with dictation/voice disabled. " + + "Tests that require dictation should gate on PASEO_DICTATION_ENABLED.", ); + return { openAiUsable: false, localModelsDir: null }; } + const dictationProvider = openAiUsable ? "openai" : "local"; const localModelsDir = dictationProvider === "local" ? defaultLocalModelsDir : null; console.log( `[e2e] Dictation STT provider: ${dictationProvider}${openAiUsable ? "" : " (OpenAI probe failed)"}`,