CherryHQ/cherry-studio · error · Error
Provider extension "${id}" not found. Did you forget to regi
Error message
Provider extension "${id}" not found. Did you forget to register it? What it means
Thrown by createVertexModelListRequest() via its internal failOrSkip() helper when options.throwOnError is set and the Vertex provider cannot even build a list request — before any HTTP call. The known reason is 'provider is not configured with iam-gcp auth' (authConfig.type !== 'iam-gcp'). Without throwOnError the same condition logs a warning and returns undefined (model listing yields zero Vertex models); with throwOnError it propagates as a hard error naming the reason.
Source
Thrown at packages/aiCore/src/core/providers/core/ExtensionRegistry.ts:491
}
/**
* 创建 provider 实例
*
* 支持两种调用方式:
* 1. 类型安全版本 - 使用已注册的 provider ID,获得完整的类型推导
* 2. 动态版本 - 使用任意字符串 ID,用于测试或动态注册的 provider
*
* @param id - Provider ID
* @param settings - Provider 配置
* @returns Provider 实例
*/
async createProvider<T extends RegisteredProviderId>(id: T, settings: CoreProviderSettingsMap[T]): Promise<ProviderV3>
async createProvider(id: string, settings?: unknown): Promise<ProviderV3>
async createProvider(id: string, settings?: unknown): Promise<ProviderV3> {
const parsed = this.parseProviderId(id)
if (!parsed) {
throw new Error(`Provider extension "${id}" not found. Did you forget to register it?`)
}
const { baseId, mode: variantSuffix } = parsed
const extension = this.get(baseId)
if (!extension) {
throw new Error(`Provider extension "${baseId}" not found. Did you forget to register it?`)
}
try {
return await extension.createProvider(settings, variantSuffix)
} catch (error) {
throw new ProviderCreationError(
`Failed to create provider "${id}"`,
id,
error instanceof Error ? error : new Error(String(error))
)
}View on GitHub (pinned to 726446b54c)
Solutions
- Open the provider settings and set the auth type to iam-gcp (Vertex AI / Google Cloud).
- Provide a valid Google Cloud service account JSON with the Vertex AI User role.
- Set the project id and region in the provider configuration.
- After reconfiguring, retry the model listing; if you do not need strict failure, the default (non-throwOnError) path will simply list zero models until auth is fixed.
Example fix
// before: provider configured with the wrong auth type
const provider = { id, type: 'vertex', authConfig: { type: 'api-key', apiKey: '...' } }
// after: correct Vertex auth
const provider = { id, type: 'vertex', authConfig: { type: 'iam-gcp', serviceAccountJson: '<...>', projectId: 'my-project', region: 'us-central1' } } Defensive patterns
Strategy: validation
Validate before calling
// Validate the provider is Vertex-capable before requesting models.
const auth = providerService.getAuthConfig(provider.id)
if (auth?.type !== 'iam-gcp') {
throw new Error(`Provider ${provider.id} is not configured with iam-gcp auth; cannot list Vertex models`)
}
await createVertexModelListRequest(provider, { throwOnError: true }) Type guard
function isIamGcpAuth(a: unknown): a is { type: 'iam-gcp'; serviceAccountJson: string; projectId: string; region: string } {
return typeof a === 'object' && a !== null && (a as any).type === 'iam-gcp'
} Try / catch
try {
await createVertexModelListRequest(provider, { throwOnError: true })
} catch (e) {
if (e instanceof Error && /Vertex AI model listing failed/.test(e.message)) {
// degrade: skip strict mode so other providers still list
logger.warn('Vertex listing skipped', { reason: e.message })
} else throw e
} Prevention
- Always set the Vertex provider's auth type to iam-gcp during setup, with a service account JSON.
- Provide a setup-time validation that rejects saving a Vertex provider without iam-gcp auth.
- Use non-throwOnError listing in normal refresh flows so a misconfigured provider degrades gracefully.
When it happens
Trigger: A provider flagged as a Vertex provider has an authConfig whose type is not 'iam-gcp' (e.g. still set to an api-key/openai-style config, or auth not configured at all); throwOnError was passed (typically a manual 'refresh models' / diagnostics action) so the precondition surfaced instead of degrading to empty.
Common situations: User added a Vertex AI provider but left the auth type on the default/openai-compatible setting; service account JSON was cleared; provider was duplicated from an OpenAI-style provider and not switched to iam-gcp; the provider record's authConfig failed to persist during setup.
Related errors
- Rerank response results must reference a valid document inde
- VertexAI requires iam-gcp auth configuration.
- OpenAI-compatible reranking model requires baseURL
- Private key must be a non-empty string
- Invalid PEM format: missing BEGIN/END markers or key content
AI-assisted analysis of CherryHQ/cherry-studio@726446b54c (2026-08-12).
Data as JSON: /api/errors/128582bc9579efe0.
Report an issue: GitHub.