Files
cleveragents-core/features/provider_fixes.feature

105 lines
4.5 KiB
Gherkin

Feature: Provider fixes — remove FakeListLLM defaults
As a developer
I want the provider system to require explicit LLM instances
So that mock providers are never used accidentally in production
@unit @providers
Scenario: AutoDebugAgent raises when no LLM provided
Given I import AutoDebugAgent for provider fix tests
When I attempt to create an AutoDebugAgent without an LLM
Then a provider-not-configured error should be raised
And the raised error should mention explicit LLM
@unit @providers
Scenario: AutoDebugAgent accepts an explicit LLM
Given I import AutoDebugAgent for provider fix tests
When I create an AutoDebugAgent with a mock FakeListLLM
Then the auto-debug agent should be created successfully
@unit @providers
Scenario: ContextAnalysisAgent raises when no LLM provided
Given I import ContextAnalysisAgent for provider fix tests
When I attempt to create a ContextAnalysisAgent without LLM
Then a provider-not-configured error should be raised
And the raised error should mention explicit LLM
@unit @providers
Scenario: ContextAnalysisAgent accepts an explicit LLM
Given I import ContextAnalysisAgent for provider fix tests
When I create a ContextAnalysisAgent with a mock FakeListLLM
Then the context analysis agent should be created successfully
@unit @providers
Scenario: PlanGenerationGraph raises when no LLM provided
Given I import PlanGenerationGraph for provider fix tests
When I attempt to create a PlanGenerationGraph without an LLM
Then a provider-not-configured error should be raised
And the raised error should mention explicit LLM
@unit @providers
Scenario: PlanGenerationGraph accepts an explicit LLM
Given I import PlanGenerationGraph for provider fix tests
When I create a PlanGenerationGraph with a mock FakeListLLM
Then the plan generation graph should be created successfully
@unit @providers
Scenario: ProviderNotConfiguredError is a ProviderError subclass
Given I import the provider exception classes
Then ProviderNotConfiguredError should be a subclass of ProviderError
@unit @providers
Scenario: ProviderNotConfiguredError stores provider name
Given I import the provider exception classes
When I create a ProviderNotConfiguredError with name "openai"
Then the error should have provider_name "openai"
@unit @providers @registry
Scenario: resolve_provider_by_name with empty name raises
Given I have a fresh ProviderRegistry for fix tests
When I call resolve_provider_by_name with empty string
Then a provider-not-configured error should be raised
@unit @providers @registry
Scenario: resolve_provider_by_name with unknown name raises
Given I have a fresh ProviderRegistry for fix tests
When I call resolve_provider_by_name with "nonexistent"
Then a provider-not-configured error should be raised
And the raised error should mention unknown provider
@unit @providers @registry
Scenario: resolve_provider_by_name with unconfigured provider raises
Given I have a fresh ProviderRegistry for fix tests
When I call resolve_provider_by_name with unconfigured "openai"
Then a provider-not-configured error should be raised
@unit @providers @registry
Scenario: Provider selection trace logging emits debug messages
Given I have a ProviderRegistry with openai key for fix tests
When I call get_default_provider_type for trace logging
Then provider selection debug messages should be logged
@unit @providers
Scenario: Container get_ai_provider raises when no providers configured
Given no provider API keys are set for fix tests
And mock AI mode is disabled for fix tests
When I call container get_ai_provider
Then a provider-not-configured error should be raised
@unit @providers
Scenario: Container get_ai_provider returns mock in test mode
Given mock AI mode is enabled for fix tests
When I call container get_ai_provider
Then a mock provider or None should be returned
@unit @providers @settings
Scenario: Settings mock_providers flag defaults to false
Given I create a fresh Settings for fix tests
Then the mock_providers setting should be False
@unit @providers @settings
Scenario: Settings mock_providers warns without test mode
Given mock_providers env is set to true
And CLEVERAGENTS_TESTING_USE_MOCK_AI is cleared
When I create a Settings with mock_providers for fix tests
Then the mock_providers setting should be True