Skip to content

Commit bbcf491

Browse files
committed
fix(aibundle): agent alias rollback
1 parent 899ca12 commit bbcf491

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/ai-bundle/src/AiBundle.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ public function loadExtension(array $config, ContainerConfigurator $container, C
111111
foreach ($config['agent'] as $agentName => $agent) {
112112
$this->processAgentConfig($agentName, $agent, $builder);
113113
}
114+
if (1 === \count($config['agent']) && isset($agentName)) {
115+
$builder->setAlias(AgentInterface::class, 'ai.agent.'.$agentName);
116+
}
114117

115118
foreach ($config['store'] ?? [] as $type => $store) {
116119
$this->processStoreConfig($type, $store, $builder);

src/ai-bundle/tests/DependencyInjection/AiBundleTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public function testInjectionAgentAliasIsRegistered()
4646
],
4747
]);
4848

49+
$this->assertTrue($container->hasAlias('Symfony\AI\Agent\AgentInterface'));
4950
$this->assertTrue($container->hasAlias('Symfony\AI\Agent\AgentInterface $myAgentAgent'));
5051
}
5152

0 commit comments

Comments
 (0)