diff --git a/docs/providers/openai.md b/docs/providers/openai.md index 703a953dccd..92593c2d3d9 100644 --- a/docs/providers/openai.md +++ b/docs/providers/openai.md @@ -825,6 +825,7 @@ compatibility fallback when the shared `OPENAI_API_KEY=... GEMINI_API_KEY=... node --import tsx scripts/dev/realtime-talk-live-smoke.ts`; the OpenAI legs verify both the backend WebSocket bridge and the browser WebRTC SDP exchange without logging secrets. + Pass `--openai-only` to run those two legs without Google credentials. diff --git a/scripts/dev/realtime-talk-live-smoke.ts b/scripts/dev/realtime-talk-live-smoke.ts index 554edddd5ab..61e3a2235af 100644 --- a/scripts/dev/realtime-talk-live-smoke.ts +++ b/scripts/dev/realtime-talk-live-smoke.ts @@ -24,6 +24,7 @@ const GOOGLE_LIVE_WS_URL = type RealtimeSmokeCliOptions = { help: boolean; + openAIOnly: boolean; }; // Keep live stacks behind their owning smoke paths so help and safety helpers stay lightweight. @@ -66,7 +67,8 @@ function usage(): string { "Usage: node --import tsx scripts/dev/realtime-talk-live-smoke.ts [options]", "", "Options:", - " -h, --help Show this help", + " --openai-only Run only the OpenAI backend and browser legs", + " -h, --help Show this help", "", "Environment:", " OPENAI_API_KEY", @@ -76,12 +78,15 @@ function usage(): string { function parseRealtimeSmokeArgs(argv = process.argv.slice(2)): RealtimeSmokeCliOptions { for (const arg of argv) { - if (arg === "--help" || arg === "-h") { + if (arg === "--help" || arg === "-h" || arg === "--openai-only") { continue; } throw new CliArgumentError(`Unknown argument: ${arg}`); } - return { help: argv.includes("--help") || argv.includes("-h") }; + return { + help: argv.includes("--help") || argv.includes("-h"), + openAIOnly: argv.includes("--openai-only"), + }; } function getEnv(name: string): string | undefined { @@ -799,16 +804,18 @@ async function main(argv = process.argv.slice(2)): Promise { results.push(await smokeOpenAIBackendBridge(openAIKey)); results.push(await smokeOpenAIWebRtc(browser, openAIKey)); } - if (!googleKey) { - results.push({ - name: "google-live-browser-ws", - ok: false, - details: { error: "GEMINI_API_KEY or GOOGLE_API_KEY missing" }, - }); - } else { - results.push(await smokeGoogleLiveBrowserWs(browser, googleKey)); + if (!cli.openAIOnly) { + if (!googleKey) { + results.push({ + name: "google-live-browser-ws", + ok: false, + details: { error: "GEMINI_API_KEY or GOOGLE_API_KEY missing" }, + }); + } else { + results.push(await smokeGoogleLiveBrowserWs(browser, googleKey)); + } + results.push(await smokeGatewayRelayBrowser(browser)); } - results.push(await smokeGatewayRelayBrowser(browser)); } finally { await browser.close(); } diff --git a/test/scripts/dev-tooling-safety.test.ts b/test/scripts/dev-tooling-safety.test.ts index 6909f73e54d..8173a81fba5 100644 --- a/test/scripts/dev-tooling-safety.test.ts +++ b/test/scripts/dev-tooling-safety.test.ts @@ -594,10 +594,18 @@ describe("script-specific dev tooling hardening", () => { }); it("formats OpenAI realtime smoke help without launching live checks", () => { - expect(realtimeSmokeTesting.parseRealtimeSmokeArgs(["--help"])).toEqual({ help: true }); + expect(realtimeSmokeTesting.parseRealtimeSmokeArgs(["--help"])).toEqual({ + help: true, + openAIOnly: false, + }); + expect(realtimeSmokeTesting.parseRealtimeSmokeArgs(["--openai-only"])).toEqual({ + help: false, + openAIOnly: true, + }); expect(realtimeSmokeTesting.usage()).toContain( "Usage: node --import tsx scripts/dev/realtime-talk-live-smoke.ts", ); + expect(realtimeSmokeTesting.usage()).toContain("--openai-only"); }); it("rejects unknown OpenAI realtime smoke args before runtime setup", () => {