{"record":{"id":"0c6e9eee368711f6","repo":"chatboxai/chatbox","slug":"cannot-find-model-with-provider-setting-provide","errorCode":null,"errorMessage":"Cannot find model with provider: ${setting.provider}","messagePattern":"Cannot find model with provider: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/shared/providers/index.ts","lineNumber":79,"sourceCode":"\n/**\n * Get provider settings from session and global settings.\n * This is a helper function that extracts and formats provider-related settings.\n */\nexport function getProviderSettings(setting: SessionSettings, globalSettings: Settings) {\n  console.debug('getProviderSettings', setting.provider, setting.modelId)\n  const provider = setting.provider\n  if (!provider) {\n    throw new Error('Model provider must not be empty.')\n  }\n\n  const registryProviders = getSystemProviders()\n  const providerBaseInfo = [...registryProviders, ...(globalSettings.customProviders || [])].find(\n    (p) => p.id === provider\n  )\n\n  if (!providerBaseInfo) {\n    throw new Error(`Cannot find model with provider: ${setting.provider}`)\n  }\n  const providerSetting = mergeSharedOAuthProviderSettings(provider, globalSettings.providers)\n  // When OAuth is active, use the provider's default API host (OAuth tokens are issued for specific endpoints)\n  const isOAuthActive = providerSetting.activeAuthMode === 'oauth' && !!providerSetting.oauth?.accessToken\n  const formattedApiHost = (\n    (isOAuthActive ? '' : providerSetting.apiHost) ||\n    providerBaseInfo.defaultSettings?.apiHost ||\n    ''\n  ).trim()\n  return {\n    providerSetting,\n    formattedApiHost,\n    providerBaseInfo,\n  }\n}\n\n/**\n * Get the model configuration from provider settings or defaults.","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/chatboxai/chatbox/blob/81571269addb6bafb589a920b2883f1e1e084fd1/src/shared/providers/index.ts#L61-L97","documentation":"Error \"Cannot find model with provider: ${setting.provider}\" thrown in chatboxai/chatbox.","triggerScenarios":"Thrown at src/shared/providers/index.ts:79 when the library encounters an invalid state.","commonSituations":"Occurs in src/shared/providers/index.ts when the configured provider id does not match any registered model provider.","solutions":["Re-select the model in session settings; the stored provider id no longer matches any registered or custom provider.","If the provider was a custom provider that was deleted, recreate it or switch to a builtin provider.","After restoring a backup, verify custom providers were imported along with sessions."],"exampleFix":"if (!providerBaseInfo) {\n  // Provider id '${setting.provider}' unknown: reset the session's provider/model selection\n}","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"81571269addb6bafb589a920b2883f1e1e084fd1","analyzedAt":"2026-08-12T21:51:44.981Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}