---
title: "Laravel AI: Trace Agent Runs With Lifecycle Events"
url: https://daily.dev/posts/laravel-ai-trace-agent-runs-with-lifecycle-events-k7bbbwg9b
source_url: https://laravel-news.com/laravel-ai-agent-run-events
type: article
source: "Laravel News"
published: 2026-08-24T13:45:00.822Z
updated: 2026-08-24T13:45:26.418Z
tags: ["architecture", "ai-agents", "php", "laravel", "observability"]
reading_time: 6
upvotes: 2
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Laravel AI: Trace Agent Runs With Lifecycle Events

**[Laravel News](https://daily.dev/sources/ln)** · 6 min read · 2 upvotes · 0 comments

## Summary

Laravel AI v0.11.0 adds per-step and per-tool lifecycle events to agent runs, replacing the previous start/end-only reporting. Every run now gets a single invocation ID shared across provider failovers, StartingStep/StepCompleted/StepFailed fire around each provider round-trip with wall timings, and InvokingTool/ToolInvoked/ToolFailed now use per-invocation IDs that survive nesting. A new AgentFailed event reports run failures that previously went unreported, and sub-agents invoked as tools now carry parentInvocationId/parentToolInvocationId linking them to their parent run. Several event constructors gained required new arguments, requiring updates to any code that constructs them manually.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://laravel-news.com/laravel-ai-agent-run-events>

## Questions this post answers

### What new events does Laravel AI 0.11.0 add for tracing agent runs?

Laravel AI 0.11.0 adds StartingStep, StepCompleted, and StepFailed around every provider round-trip, plus ToolFailed for tool handler exceptions and AgentFailed for run-level failures. Every run gets one invocation ID shared across provider failovers, StepCompleted carries wall time in milliseconds matching QueryExecuted::$time, and sub-agents get parentInvocationId and parentToolInvocationId linking them to their parent run.

_daily.dev surfaces release breakdowns like this for teams instrumenting AI agent pipelines in Laravel._

### Why did AgentFailedOver in Laravel AI require a code change when upgrading to 0.11.0?

AgentFailedOver now takes a required string invocationId as its first constructor argument, so any code manually constructing that event needs updating; listeners themselves are unaffected. Additionally, it no longer fires for the final provider in a failover chain, since that attempt has nothing left to fall back to and is reported through AgentFailed instead.

_Track breaking constructor changes like this on daily.dev before they break a Laravel upgrade._

### How do I get timing and cost data for each step of a Laravel AI agent run?

Listen for the StepCompleted event, introduced in Laravel AI 0.11.0, which carries the full StepResponse plus a float time property measuring wall time spent in the provider call in milliseconds. This lets you log per-step token usage and duration as the run happens, rather than only getting bulk step usage from the terminal event with no timing attached.

_Developers wiring observability into Laravel AI agents follow updates like this on daily.dev._

## Similar posts on daily.dev

- [Agent Run Observability in Laravel AI SDK 0.11](https://daily.dev/posts/agent-run-observability-in-laravel-ai-sdk-0-11-2ws8tt7cm) · Laravel News · 0 upvotes · 0 comments
- [Laravel's AI SDK adds sub-agents](https://daily.dev/posts/laravel-s-ai-sdk-adds-sub-agents-0wunpifv2) · Laravel News · 21 upvotes · 1 comments
- [Sentry AI Tracing with Laravel's AI SDK](https://daily.dev/posts/sentry-ai-tracing-with-laravel-s-ai-sdk-ge6abhixu) · Josh Hornby · 0 upvotes · 0 comments

---

Tags: [#architecture](https://daily.dev/tags/architecture), [#ai-agents](https://daily.dev/tags/ai-agents), [#php](https://daily.dev/tags/php), [#laravel](https://daily.dev/tags/laravel), [#observability](https://daily.dev/tags/observability)

[View this post on daily.dev](https://daily.dev/posts/laravel-ai-trace-agent-runs-with-lifecycle-events-k7bbbwg9b)
