[5.x] Add Laravel AI watcher - #1757
Conversation
Record Laravel AI run, step, tool, failover, and approval lifecycle data in Telescope without adding a hard dependency on the Laravel AI package. Add AI entry routes, frontend index and preview screens, watcher configuration, and focused tests for the new recording behavior.
|
Hi @pushpak1300 , just wanted to flag on the CI failures here — I looked into them and they're not related to this PR. The same 17 errors / 22 failures show up identically on I also double-checked compatibility: the new code sticks to plain PHP 8.0-safe syntax and only touches Is there anything else you'd like me to change or add here, or is this good to move forward as-is? |
|
Update: found the exact cause — this branch was cut before #1759 ("Test improvements", merged into |
|
Hi @taylorotwell, I am really looking forward to your feedback on my PR. This is my first contribution to a Laravel first-party package, so your feedback would be very valuable to me. If there are any violations or issues, I would appreciate it if you could point them out. I will address them promptly. If any further testing is needed, or if there is anything else I can help with, please let me know. Thank you so much in advance for reviewing my PR. Regards |
|
Hey @huzaifaarain, I’ll review this shortly. Thanks for all the work you did. |
Summary
This pull request adds first-class Telescope monitoring for Laravel AI runs.
It records AI run starts and terminal updates, provider steps, tool invocations, provider failovers, and tool approval checkpoints. The watcher stores safe summaries by default and keeps prompt content, response text, raw provider payloads, tool arguments, and tool results opt-in behind watcher configuration.
Benefit
Applications using Laravel AI can inspect agent activity in Telescope using the same list/detail workflow as other Telescope entry types. This makes it easier to debug model/provider behavior, tool calls, failovers, and approval flows during development.
Compatibility
The integration does not add a hard dependency on
laravel/ai. Laravel AI event classes are referenced by string and listeners are only registered when the package is installed.The watcher remains optional through Telescope's watcher configuration.
Tests
Validated locally with the Laravel AI-compatible stable target:
Result: 77 tests, 324 assertions.
Result: no errors.
Result: build completed successfully.