chatboxai/chatbox · error · Error
Custom provider "${providerId}" conflicts with a builtin pro
Error message
Custom provider "${providerId}" conflicts with a builtin provider ID What it means
Thrown by buildImportedProviderSettingsUpdate when an imported provider config is marked isCustom: true but its id matches a builtin provider id (e.g. 'openai', 'anthropic', 'google'). This prevents a custom provider definition from shadowing or colliding with the hardcoded builtin catalog, which would break provider resolution and credential routing.
Source
Thrown at src/renderer/components/settings/provider/importProviderState.ts:61
}
if ('sessionToken' in importedConfig && importedConfig.sessionToken) {
credentialFields.sessionToken = importedConfig.sessionToken as string
}
if ('region' in importedConfig && importedConfig.region) {
credentialFields.region = importedConfig.region as string
}
const providerSettings = {
...providers?.[providerId],
apiHost,
apiPath,
apiKey,
...credentialFields,
models: uniqueModels,
}
if ('isCustom' in importedConfig && importedConfig.isCustom && isBuiltinProviderId(providerId)) {
throw new Error(`Custom provider "${providerId}" conflicts with a builtin provider ID`)
}
if (existingProvider && !existingProvider.isCustom) {
return {
providers: {
...providers,
[providerId]: providerSettings,
},
}
}
const baseProviderInfo: CustomProviderBaseInfo = {
id: providerId,
name: providerName,
type: providerType,
iconUrl: 'iconUrl' in importedConfig ? importedConfig.iconUrl : undefined,
urls,
isCustom: true,View on GitHub (pinned to 81571269ad)
Solutions
- Change the imported provider's id to a non-builtin value (e.g. 'openai-custom' or a generated uuid) before importing.
- If the intent is to override the builtin provider, import it WITHOUT isCustom: true so it updates the builtin entry instead.
- Validate the id against isBuiltinProviderId() in the import UI and prompt the user to rename.
Example fix
// before
if ('isCustom' in importedConfig && importedConfig.isCustom && isBuiltinProviderId(providerId)) {
throw new Error(`Custom provider "${providerId}" conflicts with a builtin provider ID`)
}
// after — auto-suffix the id and warn instead of hard-failing
let finalId = providerId
if ('isCustom' in importedConfig && importedConfig.isCustom && isBuiltinProviderId(providerId)) {
finalId = `${providerId}-custom`
log.warn(`Imported custom provider id clashed with builtin; renamed to ${finalId}`)
} Defensive patterns
Strategy: validation
Validate before calling
import { isBuiltinProviderId } from '@shared/providers'
function validateImportedId(id: string, isCustom: boolean): string {
if (isCustom && isBuiltinProviderId(id)) {
return `${id}-custom` // or throw
}
return id
} Type guard
function isBuiltinId(id: string): boolean {
return isBuiltinProviderId(id)
} Try / catch
try {
return buildImportedProviderSettingsUpdate(params)
} catch (error) {
if (error instanceof Error && /conflicts with a builtin/i.test(error.message)) {
showToast(`The provider id "${id}" is reserved. Rename it before importing.`)
return {}
}
throw error
} Prevention
- Validate the imported id against isBuiltinProviderId() in the import UI before submitting.
- If overriding a builtin, import without isCustom: true.
- Suffix custom ids with a namespace (e.g. 'team-') to avoid accidental collisions.
When it happens
Trigger: Importing a shared/exported provider JSON whose id is 'openai' (or another builtin) and whose isCustom flag is true. isBuiltinProviderId(providerId) returns true, so the guard fires. The check runs after models are deduped and provider settings assembled, so all other fields are valid by this point.
Common situations: A user exports a custom provider, manually edits the JSON to use a builtin id (or renames it to clash), then imports; a team-sharing config reuses a builtin id by mistake; a migration script assigns ids that overlap the builtin set.
Related errors
- Invalid settings entry
- Unsupported search provider: ${provider}
- Knowledge base name is required
- Backup JSON entry is too large: ${path}
- Manifest contains a duplicate path: ${descriptor.path}
AI-assisted analysis of chatboxai/chatbox@81571269ad (2026-08-12).
Data as JSON: /api/errors/381060365c4820ae.
Report an issue: GitHub.