Summary
The SymfonyAiCompilerPass auto-discovery mechanism is hardcoded to only detect Symfony AI platform packages published under the symfony/ vendor namespace. Third-party Symfony AI platform implementations (e.g., mittwald/symfony-ai-platform) are not discovered, even though they implement the same interfaces and follow the same conventions.
Steps to Reproduce
-
Install a Symfony AI platform package with a non-Symfony vendor name (e.g., mittwald/symfony-ai-platform):
$ composer require -W mittwald/symfony-ai-platform dev-main
-
Clear TYPO3 caches
-
Navigate to the AiM backend module
Expected Behavior
The extension should discover and register the Symfony AI platform provider.
Actual Behavior
The backend displays: "No AI providers registered. Install an extension that provides AI capabilities."
Root Cause
In Classes/DependencyInjection/SymfonyAiCompilerPass.php, lines 139-143, the discovery logic is:
|
foreach (InstalledVersions::getInstalledPackages() as $packageName) { |
|
// Match: symfony/ai-*-platform (e.g. symfony/ai-open-ai-platform, symfony/ai-ollama-platform) |
|
if (!str_starts_with($packageName, 'symfony/ai-') || !str_ends_with($packageName, '-platform')) { |
|
continue; |
|
} |
This pattern excludes any package not published under the symfony/ vendor namespace.
Suggested Solution
Instead of matching package names, use Composer's type field for discovery. Packages declare themselves as Symfony AI platforms via:
{
"name": "mittwald/symfony-ai-platform",
"type": "symfony-ai-platform"
}
This approach:
- Is vendor-agnostic
- Follows established Composer conventions (similar to
typo3-cms-extension, etc.)
- Allows any third-party to publish compatible packages
- Is explicit rather than relying on naming patterns
However, this requires inspecting the composer.json of every installed package, so it would add additional overhead to the discovery phase. Alternatively, one could maybe relax the package name restrictions a bit (maybe also allow */symfony-ai-provider as a package key?).
Summary
The
SymfonyAiCompilerPassauto-discovery mechanism is hardcoded to only detect Symfony AI platform packages published under thesymfony/vendor namespace. Third-party Symfony AI platform implementations (e.g.,mittwald/symfony-ai-platform) are not discovered, even though they implement the same interfaces and follow the same conventions.Steps to Reproduce
Install a Symfony AI platform package with a non-Symfony vendor name (e.g.,
mittwald/symfony-ai-platform):Clear TYPO3 caches
Navigate to the AiM backend module
Expected Behavior
The extension should discover and register the Symfony AI platform provider.
Actual Behavior
The backend displays: "No AI providers registered. Install an extension that provides AI capabilities."
Root Cause
In
Classes/DependencyInjection/SymfonyAiCompilerPass.php, lines 139-143, the discovery logic is:aim/Classes/DependencyInjection/SymfonyAiCompilerPass.php
Lines 139 to 143 in 4f70d20
This pattern excludes any package not published under the
symfony/vendor namespace.Suggested Solution
Instead of matching package names, use Composer's
typefield for discovery. Packages declare themselves as Symfony AI platforms via:{ "name": "mittwald/symfony-ai-platform", "type": "symfony-ai-platform" }This approach:
typo3-cms-extension, etc.)However, this requires inspecting the
composer.jsonof every installed package, so it would add additional overhead to the discovery phase. Alternatively, one could maybe relax the package name restrictions a bit (maybe also allow*/symfony-ai-provideras a package key?).