{"record":{"id":"128582bc9579efe0","repo":"CherryHQ/cherry-studio","slug":"provider-extension-id-not-found-did-you-forg","errorCode":null,"errorMessage":"Provider extension \"${id}\" not found. Did you forget to register it?","messagePattern":"Provider extension \"(.+?)\" not found\\. Did you forget to register it\\?","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/aiCore/src/core/providers/core/ExtensionRegistry.ts","lineNumber":491,"sourceCode":"  }\n\n  /**\n   * 创建 provider 实例\n   *\n   * 支持两种调用方式:\n   * 1. 类型安全版本 - 使用已注册的 provider ID，获得完整的类型推导\n   * 2. 动态版本 - 使用任意字符串 ID，用于测试或动态注册的 provider\n   *\n   * @param id - Provider ID\n   * @param settings - Provider 配置\n   * @returns Provider 实例\n   */\n  async createProvider<T extends RegisteredProviderId>(id: T, settings: CoreProviderSettingsMap[T]): Promise<ProviderV3>\n  async createProvider(id: string, settings?: unknown): Promise<ProviderV3>\n  async createProvider(id: string, settings?: unknown): Promise<ProviderV3> {\n    const parsed = this.parseProviderId(id)\n    if (!parsed) {\n      throw new Error(`Provider extension \"${id}\" not found. Did you forget to register it?`)\n    }\n\n    const { baseId, mode: variantSuffix } = parsed\n\n    const extension = this.get(baseId)\n    if (!extension) {\n      throw new Error(`Provider extension \"${baseId}\" not found. Did you forget to register it?`)\n    }\n\n    try {\n      return await extension.createProvider(settings, variantSuffix)\n    } catch (error) {\n      throw new ProviderCreationError(\n        `Failed to create provider \"${id}\"`,\n        id,\n        error instanceof Error ? error : new Error(String(error))\n      )\n    }","sourceCodeStart":473,"sourceCodeEnd":509,"githubUrl":"https://github.com/CherryHQ/cherry-studio/blob/726446b54cd69ffe51a276638672f6d95ca0768c/packages/aiCore/src/core/providers/core/ExtensionRegistry.ts#L473-L509","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before: provider configured with the wrong auth type\nconst provider = { id, type: 'vertex', authConfig: { type: 'api-key', apiKey: '...' } }\n// after: correct Vertex auth\nconst provider = { id, type: 'vertex', authConfig: { type: 'iam-gcp', serviceAccountJson: '<...>', projectId: 'my-project', region: 'us-central1' } }","handlingStrategy":"validation","validationCode":"// Validate the provider is Vertex-capable before requesting models.\nconst auth = providerService.getAuthConfig(provider.id)\nif (auth?.type !== 'iam-gcp') {\n  throw new Error(`Provider ${provider.id} is not configured with iam-gcp auth; cannot list Vertex models`)\n}\nawait createVertexModelListRequest(provider, { throwOnError: true })","typeGuard":"function isIamGcpAuth(a: unknown): a is { type: 'iam-gcp'; serviceAccountJson: string; projectId: string; region: string } {\n  return typeof a === 'object' && a !== null && (a as any).type === 'iam-gcp'\n}","tryCatchPattern":"try {\n  await createVertexModelListRequest(provider, { throwOnError: true })\n} catch (e) {\n  if (e instanceof Error && /Vertex AI model listing failed/.test(e.message)) {\n    // degrade: skip strict mode so other providers still list\n    logger.warn('Vertex listing skipped', { reason: e.message })\n  } else throw e\n}","preventionTips":["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."],"tags":["vertex-ai","auth","iam-gcp","configuration","model-listing"],"backgroundTag":null,"analyzedSha":"726446b54cd69ffe51a276638672f6d95ca0768c","analyzedAt":"2026-08-12T17:30:37.448Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}