UAT: Cohere, Groq, and Together AI providers lack dedicated provider classes — only handled via generic LangChain dynamic imports #3135

Open
opened 2026-04-05 06:44:27 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: fix/providers/cohere-groq-together-dedicated-classes
  • Commit Message: fix(providers): add dedicated provider classes for Cohere, Groq, and Together AI
  • Milestone: None (backlog)
  • Parent Epic: #392

Background

The provider registry (src/cleveragents/providers/registry.py) supports Cohere, Groq, and Together AI as named provider types (ProviderType.COHERE, ProviderType.GROQ, ProviderType.TOGETHER), but unlike OpenAI, Anthropic, Google, and OpenRouter — which each have dedicated provider classes (OpenAIChatProvider, AnthropicChatProvider, GoogleChatProvider, OpenRouterChatProvider) — Cohere, Groq, and Together are handled only via generic LangChainChatProvider with dynamic imports inside _create_provider_llm().

What was tested:

  • Code analysis of src/cleveragents/providers/llm/ directory
  • Code analysis of src/cleveragents/providers/registry.py _create_provider_llm() and create_ai_provider() methods

Expected behavior (from spec):
The spec states that "Built-in actors are namespaced by provider (e.g., openai/, anthropic/)." The provider architecture (ADR-008) implies each supported provider should have a consistent implementation. The registry's DEFAULT_CAPABILITIES and DEFAULT_MODELS define Cohere, Groq, and Together as first-class providers, implying they should have the same level of implementation as OpenAI/Anthropic/Google.

Actual behavior:
src/cleveragents/providers/llm/ contains:

  • openai_provider.py — dedicated class
  • anthropic_provider.py — dedicated class
  • google_provider.py — dedicated class
  • openrouter_provider.py — dedicated class
  • langchain_chat_provider.py — base class

But no cohere_provider.py, groq_provider.py, or together_provider.py. These three providers are handled via # type: ignore[import-untyped] dynamic imports in _create_provider_llm() without dedicated classes. This means:

  1. No type safety for Cohere/Groq/Together provider construction
  2. No provider-specific configuration validation (unlike OpenRouterChatProvider which validates api_key and handles organization)
  3. create_ai_provider() falls through to the generic LangChainChatProvider factory for these providers, bypassing any provider-specific logic
  4. # type: ignore suppression violates the project's "no type suppression" rule (CONTRIBUTING.md)

Code location:

  • src/cleveragents/providers/registry.py lines ~450-480 (_create_provider_llm for Groq/Together/Cohere)
  • src/cleveragents/providers/llm/ — missing cohere_provider.py, groq_provider.py, together_provider.py

Steps to reproduce:

  1. ls src/cleveragents/providers/llm/ — observe missing provider files
  2. Review registry.py _create_provider_llm() — Groq/Together/Cohere use # type: ignore[import-untyped] and have no dedicated classes

Impact:
Cohere, Groq, and Together providers cannot be properly type-checked, lack provider-specific validation, and are inconsistent with the architecture of other providers.

Subtasks

  • Create src/cleveragents/providers/llm/cohere_provider.py with a CohereChatProvider class extending LangChainChatProvider, with full static typing and provider-specific validation
  • Create src/cleveragents/providers/llm/groq_provider.py with a GroqChatProvider class extending LangChainChatProvider, with full static typing and provider-specific validation
  • Create src/cleveragents/providers/llm/together_provider.py with a TogetherChatProvider class extending LangChainChatProvider, with full static typing and provider-specific validation
  • Update src/cleveragents/providers/registry.py _create_provider_llm() to instantiate the new dedicated classes for ProviderType.COHERE, ProviderType.GROQ, and ProviderType.TOGETHER instead of using generic dynamic imports
  • Remove all # type: ignore[import-untyped] suppressions from the Cohere/Groq/Together branches in registry.py
  • Update src/cleveragents/providers/llm/__init__.py to export the three new provider classes
  • Write Behave unit tests (in features/) for CohereChatProvider, GroqChatProvider, and TogetherChatProvider covering construction, validation, and error cases
  • Verify nox -e typecheck passes with zero type: ignore suppressions in the affected files
  • Verify nox -e coverage_report shows coverage >= 97%

Definition of Done

  • All subtasks above are checked off
  • cohere_provider.py, groq_provider.py, and together_provider.py exist in src/cleveragents/providers/llm/ with dedicated, fully-typed provider classes
  • No # type: ignore suppressions remain in the Cohere/Groq/Together provider code paths
  • registry.py _create_provider_llm() uses dedicated classes for all three providers (no generic fallthrough)
  • Commit created with exact message: fix(providers): add dedicated provider classes for Cohere, Groq, and Together AI
  • Commit pushed to branch fix/providers/cohere-groq-together-dedicated-classes
  • Pull Request created, reviewed (≥2 approvals), and merged
  • All nox stages pass
  • Coverage >= 97%

Backlog note: This issue was discovered during autonomous operation
on milestone v3.7.0. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.


Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-uat-tester

## Metadata - **Branch**: `fix/providers/cohere-groq-together-dedicated-classes` - **Commit Message**: `fix(providers): add dedicated provider classes for Cohere, Groq, and Together AI` - **Milestone**: None (backlog) - **Parent Epic**: #392 ## Background The provider registry (`src/cleveragents/providers/registry.py`) supports Cohere, Groq, and Together AI as named provider types (`ProviderType.COHERE`, `ProviderType.GROQ`, `ProviderType.TOGETHER`), but unlike OpenAI, Anthropic, Google, and OpenRouter — which each have dedicated provider classes (`OpenAIChatProvider`, `AnthropicChatProvider`, `GoogleChatProvider`, `OpenRouterChatProvider`) — Cohere, Groq, and Together are handled only via generic `LangChainChatProvider` with dynamic imports inside `_create_provider_llm()`. **What was tested:** - Code analysis of `src/cleveragents/providers/llm/` directory - Code analysis of `src/cleveragents/providers/registry.py` `_create_provider_llm()` and `create_ai_provider()` methods **Expected behavior (from spec):** The spec states that "Built-in actors are namespaced by provider (e.g., `openai/`, `anthropic/`)." The provider architecture (ADR-008) implies each supported provider should have a consistent implementation. The registry's `DEFAULT_CAPABILITIES` and `DEFAULT_MODELS` define Cohere, Groq, and Together as first-class providers, implying they should have the same level of implementation as OpenAI/Anthropic/Google. **Actual behavior:** `src/cleveragents/providers/llm/` contains: - `openai_provider.py` — dedicated class - `anthropic_provider.py` — dedicated class - `google_provider.py` — dedicated class - `openrouter_provider.py` — dedicated class - `langchain_chat_provider.py` — base class But **no** `cohere_provider.py`, `groq_provider.py`, or `together_provider.py`. These three providers are handled via `# type: ignore[import-untyped]` dynamic imports in `_create_provider_llm()` without dedicated classes. This means: 1. No type safety for Cohere/Groq/Together provider construction 2. No provider-specific configuration validation (unlike `OpenRouterChatProvider` which validates `api_key` and handles `organization`) 3. `create_ai_provider()` falls through to the generic `LangChainChatProvider` factory for these providers, bypassing any provider-specific logic 4. `# type: ignore` suppression violates the project's "no type suppression" rule (CONTRIBUTING.md) **Code location:** - `src/cleveragents/providers/registry.py` lines ~450-480 (`_create_provider_llm` for Groq/Together/Cohere) - `src/cleveragents/providers/llm/` — missing `cohere_provider.py`, `groq_provider.py`, `together_provider.py` **Steps to reproduce:** 1. `ls src/cleveragents/providers/llm/` — observe missing provider files 2. Review `registry.py` `_create_provider_llm()` — Groq/Together/Cohere use `# type: ignore[import-untyped]` and have no dedicated classes **Impact:** Cohere, Groq, and Together providers cannot be properly type-checked, lack provider-specific validation, and are inconsistent with the architecture of other providers. ## Subtasks - [ ] Create `src/cleveragents/providers/llm/cohere_provider.py` with a `CohereChatProvider` class extending `LangChainChatProvider`, with full static typing and provider-specific validation - [ ] Create `src/cleveragents/providers/llm/groq_provider.py` with a `GroqChatProvider` class extending `LangChainChatProvider`, with full static typing and provider-specific validation - [ ] Create `src/cleveragents/providers/llm/together_provider.py` with a `TogetherChatProvider` class extending `LangChainChatProvider`, with full static typing and provider-specific validation - [ ] Update `src/cleveragents/providers/registry.py` `_create_provider_llm()` to instantiate the new dedicated classes for `ProviderType.COHERE`, `ProviderType.GROQ`, and `ProviderType.TOGETHER` instead of using generic dynamic imports - [ ] Remove all `# type: ignore[import-untyped]` suppressions from the Cohere/Groq/Together branches in `registry.py` - [ ] Update `src/cleveragents/providers/llm/__init__.py` to export the three new provider classes - [ ] Write Behave unit tests (in `features/`) for `CohereChatProvider`, `GroqChatProvider`, and `TogetherChatProvider` covering construction, validation, and error cases - [ ] Verify `nox -e typecheck` passes with zero `type: ignore` suppressions in the affected files - [ ] Verify `nox -e coverage_report` shows coverage >= 97% ## Definition of Done - [ ] All subtasks above are checked off - [ ] `cohere_provider.py`, `groq_provider.py`, and `together_provider.py` exist in `src/cleveragents/providers/llm/` with dedicated, fully-typed provider classes - [ ] No `# type: ignore` suppressions remain in the Cohere/Groq/Together provider code paths - [ ] `registry.py` `_create_provider_llm()` uses dedicated classes for all three providers (no generic fallthrough) - [ ] Commit created with exact message: `fix(providers): add dedicated provider classes for Cohere, Groq, and Together AI` - [ ] Commit pushed to branch `fix/providers/cohere-groq-together-dedicated-classes` - [ ] Pull Request created, reviewed (≥2 approvals), and merged - [ ] All nox stages pass - [ ] Coverage >= 97% > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.7.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-uat-tester
freemo added this to the v3.6.0 milestone 2026-04-05 06:53:15 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Blocks
#392 Epic: Actor YAML & Compiler
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#3135
No description provided.