darkwood/ia-exception-bundle
Symfony bundle that enriches HTTP 500 error pages with AI-powered exception analysis via Symfony AI. Replaces raw stack traces with clear explanations, likely causes, and fix suggestions. Supports caching and optional async loading to avoid blocking requests.
kernel.exception), Twig templating, and symfony/ai-bundle. The bundle extends Symfony’s native error handling without requiring architectural changes.App\Exceptions\Handler and render() method differ from Symfony’s ExceptionListener/ErrorRenderer.symfony/ai-bundle equivalent; would need a custom AI client integration (e.g., Guzzle + OpenAI API).__ai_exception) would require Laravel-specific routing (e.g., Livewire, Inertia, or custom JS polling)./api/ai/exception) and call it from Laravel via HTTP. This decouples AI logic but adds latency.queue: system for async analysis and Blade templates for rendering.composer require + config update.symfony/ai-bundle (v0.6+) and an LLM provider (e.g., OpenAI). No breaking changes to existing error handling.symfony/ai-bundle with a Laravel-compatible AI client.App\Exceptions\Handler::render() to inject AI analysis.ErrorRenderer or ExceptionListener; would need polyfills.| Risk Area | Symfony Risk | Laravel Risk | Mitigation Strategy |
|---|---|---|---|
| Dependency Conflicts | Low | Medium | Use symfony/ai-bundle as a microservice or replace with Laravel-compatible AI client. |
| Async Implementation | Low | High | For Laravel, use Livewire/Inertia for async updates or queue-based background processing. |
| Template Rendering | Low | Medium | Convert Twig templates to Blade or use a headless API response. |
| AI Integration | Low | Medium | Abstract AI calls behind a service interface for easier swapping. |
| Performance | Low | Low | Cache responses (PSR-6 in Symfony; Laravel’s cache: in Laravel). |
| Security | Low | Medium | Sanitize exception data before sending to AI (same for both stacks). |
| Error Handling | Low | High | Ensure fallback to default Laravel error pages if AI fails. |
symfony/ai-bundle compatible with the target LLM (e.g., OpenAI, Mistral)? If not, can it be replaced?include_trace: false must be enforced.kernel.exception event.symfony/ai-bundle for LLM integration.symfony/ai-bundle or willing to adopt it./api/ai/exception).Http::post('/ai/exception', $exceptionData)).symfony/ai-bundle with Guzzle/OpenAI API calls.App\Exceptions\Handler::render().queue: for async analysis.__ai_exception) with Laravel’s Livewire/Inertia for frontend updates.| Step | Symfony | Laravel (Wrapper) | Laravel (Microservice) |
|---|---|---|---|
| 1. Prerequisites | Install symfony/ai-bundle |
Install Guzzle/OpenAI client | Deploy Symfony microservice |
| 2. Configuration | Add darkwood/ia-exception-bundle |
Create Laravel package | Configure Laravel to call API |
| 3. Error Handling | Enable bundle in bundles.php |
Override App\Exceptions\Handler |
Extend Laravel’s error pages |
| 4. Async Setup | Configure async: true in YAML |
Implement queue/listener | Use Livewire/Inertia for updates |
| 5. Templates | Use Twig templates | Convert to Blade | Fetch HTML via API |
| 6. Testing | Test kernel.exception events |
Test render() overrides |
Test API endpoints |
| 7. Deployment | Composer install + config | Publish package | Deploy microservice |
symfony/ai-bundle.ErrorRenderer has no Laravel equivalent.__ai_exception) requires custom Laravel routing.ai.yaml and darkwood_ia_exception.yaml, enable for a single environment (e.g., staging).async: true and monitor AI cost/performance.How can I help you explore Laravel packages today?