{"record":{"id":"3d03332aa659e024","repo":"chatboxai/chatbox","slug":"model-provider-must-not-be-empty","errorCode":null,"errorMessage":"Model provider must not be empty.","messagePattern":"Model provider must not be empty\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/shared/providers/index.ts","lineNumber":70,"sourceCode":"export type { CreateModelConfig, ProviderDefinition, ProviderDefinitionInput }\n\nexport function isBuiltinProviderId(providerId: string): boolean {\n  return !!getProviderDefinition(providerId)\n}\n\nexport function getBuiltinProviderIds(): string[] {\n  return getSystemProviders().map((provider) => provider.id)\n}\n\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()","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/chatboxai/chatbox/blob/81571269addb6bafb589a920b2883f1e1e084fd1/src/shared/providers/index.ts#L52-L88","documentation":"Error \"Model provider must not be empty.\" thrown in chatboxai/chatbox.","triggerScenarios":"Thrown at src/shared/providers/index.ts:70 when the library encounters an invalid state.","commonSituations":"Occurs in src/shared/providers/index.ts when a provider lookup is attempted with an empty or whitespace-only provider name.","solutions":["Select a model/provider in the chat or session settings before sending a message.","If settings were restored from a backup or older version, re-pick the model so settings.provider is populated.","Check that no code path constructs SessionSettings without a provider field."],"exampleFix":"const provider = setting.provider\nif (!provider) {\n  // Open the model selector and choose a provider for this session\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"}