chatboxai/chatbox · error · Error

Cannot find model with provider: ${setting.provider}

Error message

Cannot find model with provider: ${setting.provider}

What it means

Error "Cannot find model with provider: ${setting.provider}" thrown in chatboxai/chatbox.

Source

Thrown at src/shared/providers/index.ts:79

/**
 * Get provider settings from session and global settings.
 * This is a helper function that extracts and formats provider-related settings.
 */
export function getProviderSettings(setting: SessionSettings, globalSettings: Settings) {
  console.debug('getProviderSettings', setting.provider, setting.modelId)
  const provider = setting.provider
  if (!provider) {
    throw new Error('Model provider must not be empty.')
  }

  const registryProviders = getSystemProviders()
  const providerBaseInfo = [...registryProviders, ...(globalSettings.customProviders || [])].find(
    (p) => p.id === provider
  )

  if (!providerBaseInfo) {
    throw new Error(`Cannot find model with provider: ${setting.provider}`)
  }
  const providerSetting = mergeSharedOAuthProviderSettings(provider, globalSettings.providers)
  // When OAuth is active, use the provider's default API host (OAuth tokens are issued for specific endpoints)
  const isOAuthActive = providerSetting.activeAuthMode === 'oauth' && !!providerSetting.oauth?.accessToken
  const formattedApiHost = (
    (isOAuthActive ? '' : providerSetting.apiHost) ||
    providerBaseInfo.defaultSettings?.apiHost ||
    ''
  ).trim()
  return {
    providerSetting,
    formattedApiHost,
    providerBaseInfo,
  }
}

/**
 * Get the model configuration from provider settings or defaults.

View on GitHub (pinned to 81571269ad)

Solutions

  1. Re-select the model in session settings; the stored provider id no longer matches any registered or custom provider.
  2. If the provider was a custom provider that was deleted, recreate it or switch to a builtin provider.
  3. After restoring a backup, verify custom providers were imported along with sessions.

Example fix

if (!providerBaseInfo) {
  // Provider id '${setting.provider}' unknown: reset the session's provider/model selection
}

When it happens

Trigger: Thrown at src/shared/providers/index.ts:79 when the library encounters an invalid state.

Common situations: Occurs in src/shared/providers/index.ts when the configured provider id does not match any registered model provider.


AI-assisted analysis of chatboxai/chatbox@81571269ad (2026-08-12). Data as JSON: /api/errors/0c6e9eee368711f6. Report an issue: GitHub.