@@ -456,6 +456,7 @@ private function processAgentConfig(string $name, array $config, ContainerBuilde
456456 $ container ->setDefinition ('ai.agent. ' .$ name .'.model ' , $ modelDefinition );
457457
458458 // AGENT
459+ $ agentId = 'ai.agent. ' .$ name ;
459460 $ agentDefinition = (new Definition (Agent::class))
460461 ->addTag ('ai.agent ' , ['name ' => $ name ])
461462 ->setArgument (0 , new Reference ($ config ['platform ' ]))
@@ -516,8 +517,8 @@ private function processAgentConfig(string $name, array $config, ContainerBuilde
516517 ->replaceArgument (0 , new Reference ('ai.toolbox. ' .$ name ));
517518
518519 $ container ->setDefinition ('ai.tool.agent_processor. ' .$ name , $ toolProcessorDefinition )
519- ->addTag ('ai.agent.input_processor ' , ['agent ' => $ name , 'priority ' => -10 ])
520- ->addTag ('ai.agent.output_processor ' , ['agent ' => $ name , 'priority ' => -10 ]);
520+ ->addTag ('ai.agent.input_processor ' , ['agent ' => $ agentId , 'priority ' => -10 ])
521+ ->addTag ('ai.agent.output_processor ' , ['agent ' => $ agentId , 'priority ' => -10 ]);
521522 } else {
522523 if ($ config ['fault_tolerant_toolbox ' ] && !$ container ->hasDefinition ('ai.fault_tolerant_toolbox ' )) {
523524 $ container ->setDefinition ('ai.fault_tolerant_toolbox ' , new Definition (FaultTolerantToolbox::class))
@@ -526,16 +527,16 @@ private function processAgentConfig(string $name, array $config, ContainerBuilde
526527 }
527528
528529 $ container ->getDefinition ('ai.tool.agent_processor ' )
529- ->addTag ('ai.agent.input_processor ' , ['agent ' => $ name , 'priority ' => -10 ])
530- ->addTag ('ai.agent.output_processor ' , ['agent ' => $ name , 'priority ' => -10 ]);
530+ ->addTag ('ai.agent.input_processor ' , ['agent ' => $ agentId , 'priority ' => -10 ])
531+ ->addTag ('ai.agent.output_processor ' , ['agent ' => $ agentId , 'priority ' => -10 ]);
531532 }
532533 }
533534
534535 // STRUCTURED OUTPUT
535536 if ($ config ['structured_output ' ]) {
536537 $ container ->getDefinition ('ai.agent.structured_output_processor ' )
537- ->addTag ('ai.agent.input_processor ' , ['agent ' => $ name , 'priority ' => -20 ])
538- ->addTag ('ai.agent.output_processor ' , ['agent ' => $ name , 'priority ' => -20 ]);
538+ ->addTag ('ai.agent.input_processor ' , ['agent ' => $ agentId , 'priority ' => -20 ])
539+ ->addTag ('ai.agent.output_processor ' , ['agent ' => $ agentId , 'priority ' => -20 ]);
539540 }
540541
541542 // TOKEN USAGE TRACKING
@@ -555,7 +556,7 @@ private function processAgentConfig(string $name, array $config, ContainerBuilde
555556
556557 if ($ container ->hasDefinition ('ai.platform.token_usage_processor. ' .$ platform )) {
557558 $ container ->getDefinition ('ai.platform.token_usage_processor. ' .$ platform )
558- ->addTag ('ai.agent.output_processor ' , ['agent ' => $ name , 'priority ' => -30 ]);
559+ ->addTag ('ai.agent.output_processor ' , ['agent ' => $ agentId , 'priority ' => -30 ]);
559560 }
560561 }
561562 }
@@ -568,7 +569,7 @@ private function processAgentConfig(string $name, array $config, ContainerBuilde
568569 $ config ['include_tools ' ] ? new Reference ('ai.toolbox. ' .$ name ) : null ,
569570 new Reference ('logger ' , ContainerInterface::IGNORE_ON_INVALID_REFERENCE ),
570571 ])
571- ->addTag ('ai.agent.input_processor ' , ['agent ' => $ name , 'priority ' => -30 ]);
572+ ->addTag ('ai.agent.input_processor ' , ['agent ' => $ agentId , 'priority ' => -30 ]);
572573
573574 $ container ->setDefinition ('ai.agent. ' .$ name .'.system_prompt_processor ' , $ systemPromptInputProcessorDefinition );
574575 }
@@ -579,8 +580,8 @@ private function processAgentConfig(string $name, array $config, ContainerBuilde
579580 ->setArgument (4 , new Reference ('logger ' , ContainerInterface::IGNORE_ON_INVALID_REFERENCE ))
580581 ;
581582
582- $ container ->setDefinition (' ai.agent. ' . $ name , $ agentDefinition );
583- $ container ->registerAliasForArgument (' ai.agent. ' . $ name , AgentInterface::class, (new Target ($ name .'Agent ' ))->getParsedName ());
583+ $ container ->setDefinition ($ agentId , $ agentDefinition );
584+ $ container ->registerAliasForArgument ($ agentId , AgentInterface::class, (new Target ($ name .'Agent ' ))->getParsedName ());
584585 }
585586
586587 /**
0 commit comments