{"record":{"id":"0cdd8cbc5cf0026c","repo":"ruvnet/ruflo","slug":"unknown-provider-config-provider","errorCode":null,"errorMessage":"Unknown provider: ${config.provider}","messagePattern":"Unknown provider: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/providers/src/provider-manager.ts","lineNumber":131,"sourceCode":"      config,\n      logger: this.logger,\n    };\n\n    switch (config.provider) {\n      case 'anthropic':\n        return new AnthropicProvider(options);\n      case 'openai':\n        return new OpenAIProvider(options);\n      case 'google':\n        return new GoogleProvider(options);\n      case 'cohere':\n        return new CohereProvider(options);\n      case 'ollama':\n        return new OllamaProvider(options);\n      case 'ruvector':\n        return new RuVectorProvider(options);\n      default:\n        throw new Error(`Unknown provider: ${config.provider}`);\n    }\n  }\n\n  /**\n   * Complete a request with automatic provider selection\n   */\n  async complete(request: LLMRequest, preferredProvider?: LLMProvider): Promise<LLMResponse> {\n    // Check cache first\n    if (this.config.cache?.enabled) {\n      const cached = this.getCached(request);\n      if (cached) {\n        this.logger.debug('Cache hit', { requestId: request.requestId });\n        return cached;\n      }\n    }\n\n    // Select provider\n    const provider = preferredProvider","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/providers/src/provider-manager.ts#L113-L149","documentation":"ProviderManager.createProvider() switches on config.provider and only recognizes 'anthropic', 'openai', 'google', 'cohere', 'ollama' and 'ruvector'; every other value falls through to a default that throws a plain Error. The comparison is case-sensitive.","triggerScenarios":"A ProviderManagerConfig whose providers[] entry has provider: 'azure-openai', 'groq', 'mistral', 'bedrock', or a case variant like 'OpenAI' - initialize() then fails (the manager logs 'Failed to initialize ...' and skips that provider, leaving it absent from the registry).","commonSituations":"Provider id from an env var with different casing/whitespace; config authored for a newer version supporting more vendors; copy-pasted example using an alias; trailing whitespace after JSON/YAML edit.","solutions":["Use one of the exact case-sensitive ids: anthropic | openai | google | cohere | ollama | ruvector","Normalize the value at config load: trim() + toLowerCase() before it reaches the manager","After initialize(), check manager.getProvider(id) returned a provider - initialization failures are logged, not thrown, so a typo silently yields a missing provider","For unsupported vendors, instantiate the provider class yourself and pass it as preferredProvider to manager.complete()"],"exampleFix":"// before\nproviders: [{ provider: 'OpenAI' as any, apiKey, model: 'gpt-4o' }] // capital O -> Unknown provider\n\n// after\nproviders: [{ provider: 'openai', apiKey, model: 'gpt-4o' }] // exact registry id","handlingStrategy":"validation","validationCode":"const SUPPORTED_PROVIDERS = ['anthropic', 'openai', 'google', 'cohere', 'ollama', 'ruvector'] as const;\n\nfor (const p of managerConfig.providers) {\n  if (!SUPPORTED_PROVIDERS.includes(p.provider as never)) {\n    throw new Error(\n      `Unsupported provider '${p.provider}'. Supported: ${SUPPORTED_PROVIDERS.join(', ')}`\n    );\n  }\n}\nawait manager.initialize();","typeGuard":"const SUPPORTED_PROVIDERS = ['anthropic', 'openai', 'google', 'cohere', 'ollama', 'ruvector'] as const;\ntype SupportedProviderId = (typeof SUPPORTED_PROVIDERS)[number];\n\nfunction isSupportedProvider(v: unknown): v is SupportedProviderId {\n  return typeof v === 'string' && (SUPPORTED_PROVIDERS as readonly string[]).includes(v.trim().toLowerCase())\n    ? true\n    : false;\n}","tryCatchPattern":null,"preventionTips":["Whitelist provider ids against the factory's known set before calling initialize()","Normalize env-supplied provider ids: trim() and toLowerCase() at config load","After initialize(), assert manager.getProvider(id) exists - createProvider failures are logged and skipped, not thrown"],"tags":["config","provider-registry","factory","validation","startup"],"backgroundTag":"unsupported-provider","analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}