fix(providers): wire OpenAIChatProvider and AnthropicChatProvider into ProviderRegistry #3464

Merged
freemo merged 1 commits from fix/backlog-openai-anthropic-provider-registry-integration into master 2026-04-05 21:07:03 +00:00

1 Commits

Author SHA1 Message Date
freemo f44060e857 fix(providers): wire OpenAIChatProvider and AnthropicChatProvider into ProviderRegistry
CI / lint (pull_request) Successful in 20s
CI / typecheck (pull_request) Successful in 51s
CI / quality (pull_request) Successful in 34s
CI / security (pull_request) Successful in 1m4s
CI / build (pull_request) Successful in 18s
CI / helm (pull_request) Successful in 22s
CI / unit_tests (pull_request) Successful in 6m54s
CI / e2e_tests (pull_request) Successful in 17m37s
CI / integration_tests (pull_request) Successful in 23m11s
CI / docker (pull_request) Successful in 1m32s
CI / coverage (pull_request) Successful in 10m54s
CI / status-check (pull_request) Successful in 1s
CI / benchmark-publish (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Successful in 56m53s
Previously, ProviderRegistry.create_ai_provider() dispatched to dedicated
provider classes only for Google and OpenRouter. For OpenAI and Anthropic,
execution fell through to the generic LangChainChatProvider factory, leaving
OpenAIChatProvider and AnthropicChatProvider as dead code in production.

This commit:
- Adds ProviderType.OPENAI dispatch branch in create_ai_provider() to
  instantiate OpenAIChatProvider with the configured API key and model
- Adds ProviderType.ANTHROPIC dispatch branch in create_ai_provider() to
  instantiate AnthropicChatProvider with the configured API key and model
- Both branches raise ValueError with the missing env var name when the
  API key is not configured, consistent with Google and OpenRouter branches
- Updates src/cleveragents/providers/llm/__init__.py to export all four
  dedicated provider classes (OpenAIChatProvider, AnthropicChatProvider,
  GoogleChatProvider, OpenRouterChatProvider)
- Updates provider_registry_coverage.feature to assert that create_ai_provider
  returns OpenAIChatProvider for openai and AnthropicChatProvider for anthropic
- Adds new scenarios for Anthropic dispatch and missing-key error paths for
  both OpenAI and Anthropic
- Updates the 'AI provider exposes working llm factory' scenario to use groq
  (which still goes through the generic LangChainChatProvider path) since
  OpenAI now uses the dedicated class
- Adds step definitions for OpenAIChatProvider and AnthropicChatProvider
  isinstance assertions

Closes #3427
2026-04-05 18:00:27 +00:00