From fd016e0846a4d8d4b98c0fe1e82384757485026a Mon Sep 17 00:00:00 2001 From: Ra Date: Tue, 20 Oct 2026 04:11:55 -0400 Subject: [PATCH] fix: replace retired gemini-2.5-flash with gemini-3.8-flash gemini-2.5-flash was retired for new API keys: it still shows up in ListModels but 404s on generateContent, so anyone bringing a new Gemini key through LLM Settings or the server-side proxy got a broken model with no obvious cause. Points to gemini-3.8-flash everywhere the model id was hardcoded (streaming chat path, the API proxy route, and the local verify script). Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude Sonnet 5 Co-Authored-By: Happy --- scripts/verify-gemini.js | 2 +- src/app/api/gemini/route.ts | 2 +- src/lib/llm.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/verify-gemini.js b/scripts/verify-gemini.js index a4b2cae..d5241bc 100644 --- a/scripts/verify-gemini.js +++ b/scripts/verify-gemini.js @@ -13,7 +13,7 @@ async function verifyGemini() { console.log('Found GEMINI_API_KEY, testing...'); const genAI = new GoogleGenerativeAI(apiKey); - const model = genAI.getGenerativeModel({ model: "gemini-2.5-flash" }); + const model = genAI.getGenerativeModel({ model: "gemini-3.8-flash" }); try { const result = await model.generateContent("Hello, are you working?"); diff --git a/src/app/api/gemini/route.ts b/src/app/api/gemini/route.ts index 8c687a8..6ce9a0b 100644 --- a/src/app/api/gemini/route.ts +++ b/src/app/api/gemini/route.ts @@ -7,7 +7,7 @@ export const dynamic = "force-dynamic"; // Initialize Gemini with server-side key const genAI = new GoogleGenerativeAI(process.env.GEMINI_API_KEY || ""); -const model = genAI.getGenerativeModel({ model: "gemini-2.5-flash" }); +const model = genAI.getGenerativeModel({ model: "gemini-3.8-flash" }); interface GeminiErrorPayload { error: string; diff --git a/src/lib/llm.ts b/src/lib/llm.ts index d9c969e..a8ef5f9 100644 --- a/src/lib/llm.ts +++ b/src/lib/llm.ts @@ -442,7 +442,7 @@ class GeminiEngineWrapper implements LLMEngine { const genAI = new GoogleGenerativeAI(apiKey); const model = genAI.getGenerativeModel({ - model: "gemini-2.5-flash", + model: "gemini-3.8-flash", }); const chat = model.startChat({ history });