-
-
Notifications
You must be signed in to change notification settings - Fork 116
Description
Bug Report
Environment:
- symfony/ai-bundle: dev-main (installed from git on 2025-08-25)
- Symfony: 7.3
- PHP: 8.3
- Platform: Docker with FrankenPHP
Issue:
When configuring Anthropic agents in ai.yaml, the application fails to clear cache and throws a service definition error.
Error Message:
In DefinitionErrorExceptionPass.php line 48:
Invalid constructor argument 3 for service "ai.platform.anthropic": argument 2 must be defined before. Check your service definition.
Configuration Used:
ai:
platform:
anthropic:
api_key: '%env(ANTHROPIC_API_KEY)%'
agent:
blog_generator:
platform: 'ai.platform.anthropic'
model:
class: 'Symfony\AI\Platform\Bridge\Anthropic\Claude'
name: !php/const Symfony\AI\Platform\Bridge\Anthropic\Claude::SONNET_35
system_prompt: "Tu es un rédacteur web expert."Steps to Reproduce:
- Install symfony/ai-bundle from dev-main
- Configure Anthropic platform with valid API key
- Configure at least one agent using Anthropic Claude models
- Run symfony console cache:clear
Expected Behavior:
Cache should clear successfully and Anthropic agents should be available.
Actual Behavior:
Cache clear fails with service definition error related to constructor arguments.
Additional Context:
- Mistral configuration works perfectly with the same setup
- The error suggests an issue with the service definition in the Anthropic bridge
- This prevents using Anthropic agents entirely
- Switching to Mistral platform works as expected
Workaround:
Currently using Mistral as alternative, but Anthropic support is needed for production requirements.
Service Definition Debug:
The error seems to indicate that the ai.platform.anthropic service has incorrect constructor argument ordering or missing dependencies.
Would appreciate guidance on:
- Is this a known issue with dev-main?
- Are there specific configuration requirements for Anthropic not documented?
- Is there a fix or workaround available?