moeru-ai/airi · error · Error
Provider definition with id "${definitionId}" not found.
Error message
Provider definition with id "${definitionId}" not found. What it means
Thrown by InferenceServiceProvidersService.buildLocal when getDefinedProvider(definitionId) returns undefined. buildLocal constructs a local provider instance keyed by a registered definition; if the definitionId is not in the provider registry, it cannot create a valid provider and fails fast. This is a configuration/integrity error, not a network error.
Source
Thrown at packages/stage-ui/src/services/inference-service-providers.ts:103
* Use when:
* - Wiring controller stores to provider domain operations.
* - Tests need to replace the whole service surface with one mock object.
*
* Expects:
* - No runtime dependencies are required yet.
*
* Returns:
* - A stable object containing provider domain operations.
*/
export function createInferenceServiceProvidersService(): InferenceServiceProvidersService {
function requestOptions(options?: InferenceServiceProviderServiceOptions): RequestOptions | undefined {
return options?.abortSignal ? { init: { signal: options.abortSignal } } : undefined
}
function buildLocal(definitionId: string, initialConfig: Record<string, unknown> = {}): InferenceServiceProvider {
const definition = getDefinedProvider(definitionId)
if (!definition)
throw new Error(`Provider definition with id "${definitionId}" not found.`)
return {
id: nanoid(),
definitionId,
config: initialConfig,
status: 'unconfigured',
}
}
function normalize(value: unknown): InferenceServiceProvider {
const item = value as InferenceServiceProvider & {
validated: boolean
validationBypassed: boolean
}
let status: ProviderValidationStatus = 'unconfigured'
if (item.validated)
status = 'configured'
else if (item.validationBypassed)View on GitHub (pinned to 27111382b4)
Solutions
- Verify the definitionId against the list returned by getDefinedProvider / the provider registry; correct typos or update to the current id.
- When loading persisted providers, drop or migrate entries whose definitionId is no longer registered rather than calling buildLocal on them.
- Ensure the provider module that registers the definition is imported in the current build.
- Add a fallback that maps legacy ids to current ones during migration.
Example fix
// before
const definition = getDefinedProvider(definitionId)
if (!definition)
throw new Error(`Provider definition with id "${definitionId}" not found.`)
// caller-side: validate before building
if (!getDefinedProvider(id)) {
console.warn(`Skipping unregistered provider definition: ${id}`)
return null
}
return buildLocal(id, config) Defensive patterns
Strategy: type-guard
Validate before calling
import { getDefinedProvider } from '../../libs/providers/providers'
function isRegisteredDefinitionId(id: string): boolean {
return !!getDefinedProvider(id)
}
// before building
if (!isRegisteredDefinitionId(definitionId)) {
// migrate/drop stale persisted entry, or prompt user to reconfigure
return null
}
return buildLocal(definitionId, config) Type guard
function isRegisteredProviderDefinition(definitionId: string): boolean {
return !!getDefinedProvider(definitionId)
} Try / catch
try {
return buildLocal(definitionId, config)
}
catch (error) {
if (String(error).includes('Provider definition with id')) {
// drop or migrate the stale persisted config
removePersistedProvider(definitionId)
return null
}
throw error
} Prevention
- When loading persisted providers, filter out entries whose definitionId is no longer registered instead of calling buildLocal on them.
- Keep a legacy-id-to-current-id migration map across provider renames.
- Ensure all provider modules that register definitions are imported in the current build.
When it happens
Trigger: Calling buildLocal('some-id') where 'some-id' is not among the registered provider definitions (typo, removed provider, or a persisted config referencing a definition that no longer exists after an upgrade). Also when a dynamic/legacy definitionId was never registered in the current build.
Common situations: Persisted provider config in localStorage/DB referencing a definitionId that was renamed or removed in a newer app version; typo in a hardcoded definitionId; provider module not imported so its defineProvider never ran; feature-flagged provider disabled at build time.
Related errors
- Provider '${requestedProvider}' not found.
- No active chat provider or model configured
- Failed to resolve chat provider "${providerId}"
- Artistry provider is disabled.
- Nano Banana API Key not configured
AI-assisted analysis of moeru-ai/airi@27111382b4 (2026-08-12).
Data as JSON: /api/errors/eb48ed731722833a.
Report an issue: GitHub.