{"record":{"id":"6a0a763c43fd9d9b","repo":"thedotmack/claude-mem","slug":"invalid-gemini-model-configuredmodel-falling","errorCode":null,"errorMessage":"Invalid Gemini model \"${configuredModel}\", falling back to ${defaultModel}","messagePattern":"Invalid Gemini model \"(.+?)\", falling back to (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/services/worker/GeminiProvider.ts","lineNumber":413,"sourceCode":"    const settings = SettingsDefaultsManager.loadFromFile(settingsPath);\n\n    const apiKey = settings.CLAUDE_MEM_GEMINI_API_KEY || getCredential('GEMINI_API_KEY') || '';\n\n    const defaultModel: GeminiModel = 'gemini-flash-latest';\n    const configuredModel = settings.CLAUDE_MEM_GEMINI_MODEL || defaultModel;\n    const validModels: GeminiModel[] = [\n      'gemini-flash-latest',\n      'gemini-flash-lite-latest',\n      'gemini-3.5-flash',\n      'gemini-3.1-flash-lite',\n      'gemini-3-flash-preview',\n    ];\n\n    let model: GeminiModel;\n    if (validModels.includes(configuredModel as GeminiModel)) {\n      model = configuredModel as GeminiModel;\n    } else {\n      logger.warn('SDK', `Invalid Gemini model \"${configuredModel}\", falling back to ${defaultModel}`, {\n        configured: configuredModel,\n        validModels,\n      });\n      model = defaultModel;\n    }\n\n    const rateLimitingEnabled = settings.CLAUDE_MEM_GEMINI_RATE_LIMITING_ENABLED !== 'false';\n\n    return { apiKey, model, rateLimitingEnabled };\n  }\n}\n\nexport function isGeminiAvailable(): boolean {\n  const settingsPath = paths.settings();\n  const settings = SettingsDefaultsManager.loadFromFile(settingsPath);\n  return !!(settings.CLAUDE_MEM_GEMINI_API_KEY || getCredential('GEMINI_API_KEY'));\n}\n","sourceCodeStart":395,"sourceCodeEnd":431,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/d8bc9755e74915e5c3b999181e10a67c889bce2a/src/services/worker/GeminiProvider.ts#L395-L431","documentation":"This warning fires in getGeminiConfig when the configured Gemini model name is not in the list of valid GeminiModel values. Instead of failing, the provider falls back to defaultModel so the session can still run. It indicates a configuration typo or an unsupported/outdated model string.","triggerScenarios":"getGeminiConfig reads the configured model and validModels.includes(configuredModel) is false — e.g. model set to a name not in the validModels array.","commonSituations":"Typo in config (e.g. 'gemini-pro-1.5' vs 'gemini-1.5-pro'); using a model name from a newer Gemini release before the library supports it; environment/config value copied from another provider.","solutions":["Set the model to one of the values listed in validModels in the log payload.","Update the library to a version that supports the desired Gemini model.","Remove the explicit model config to accept the defaultModel.","Check for casing/typo mistakes against the GeminiModel type definition."],"exampleFix":"// before\nGEMINI_MODEL=gemini-1.5-pro-latest\n// after\nGEMINI_MODEL=gemini-1.5-pro","handlingStrategy":"validation","validationCode":"import { GeminiModel } from './GeminiProvider';\nconst VALID = ['gemini-2.0-flash','gemini-1.5-pro' /* per validModels */];\nif (!VALID.includes(process.env.GEMINI_MODEL)) {\n  console.warn(`Unknown model ${process.env.GEMINI_MODEL}, default will be used`);\n}","typeGuard":"const isGeminiModel = (m: string): m is GeminiModel =>\n  validModels.includes(m as GeminiModel);","tryCatchPattern":null,"preventionTips":["Validate model names against validModels at config-load time","Pin model strings in config, not ad-hoc env edits","Upgrade the library before adopting newly released Gemini models"],"tags":["config","model-validation","fallback"],"backgroundTag":"invalid-enum-value","analyzedSha":"d8bc9755e74915e5c3b999181e10a67c889bce2a","analyzedAt":"2026-09-17T16:40:26.182Z","contentChangedAt":"2026-09-17T16:40:26.182Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}