The Wire · Showcase
LARAVEL AI SHIPPING OBSERVABLE AGENT RUNS WITH FULL EVENT TRACING
By RepoJournal · Filed · About Laravel
A coordinated five-PR stack lands complete run context instrumentation, closing the observation gap that made agent failures invisible to monitoring.
The Laravel AI package shipped a complete run instrumentation layer that makes every step, tool invocation, and failure visible to listeners [1] [2] [3] [4] [5]. Until now, a run that hit a tool failure or gateway exception would dispatch nothing, leaving monitoring blind to anything but the final result. `AgentFailed` now reports terminal failures once per run, and sub-agents invoked as tools carry `parentInvocationId` references back to their parent context, so nested execution traces forward cleanly. The loop also emits `StartingStep`, `StepCompleted`, and `StepFailed` around every provider round-trip, plus `ToolFailed` captures exceptions from tool handlers with timing data. This is the instrumentation baseline every production agent deployment needs.
Across MCP, the client now mirrors annotated tool parameters into request headers [7], letting infrastructure in front of an MCP server (gateways, WAFs, routers) act on tool arguments without parsing the JSON-RPC body. Searchable tool catalogs also landed, letting servers hide large tool lists behind `search_tools` / `execute_tools` meta-tools [6].
In Surveyor, Eloquent attribute resolution now handles `Attribute::get()` and `new Attribute()` alongside `Attribute::make()` [8], and singular relations like `HasOne` and `BelongsTo` now type as nullable [9], matching their actual runtime behavior.
Framework picked up closure support for `wherePivot()` and `orWherePivot()` [11], letting custom pivot model scopes run directly from relationship queries. `orWhereKey()` and `orWhereKeyNot()` filled a long-standing gap [12], and queued event listeners now support the `#[DebounceFor]` attribute [13] for coalescing repeated events on the same resource. Socialite validated Facebook OIDC token nonces [10], and Redis command retry logic improved for transient failures [14].
One email a day. Unsubscribe in one click.
Keep up with Laravel in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.
One email a day. Unsubscribe in one click. Read a past issue →
Action items
- → Review the run context instrumentation PRs if you're building agent monitoring or tracing laravel/ai [plan]
- → Upgrade Surveyor if you use Eloquent attributes or nullable relations in IDEs laravel/surveyor [plan]
- → Adopt closure-based wherePivot() in new queries targeting custom pivot models laravel/framework [monitor]
References
- [1] Report a run's terminal failure ↗ laravel/ai
- [2] Link an agent invoked as a tool back to its parent ↗ laravel/ai
- [3] Report tool failures and how long a tool ran ↗ laravel/ai
- [4] Report each generation step through the run context ↗ laravel/ai
- [5] Report tool invocations through a run context ↗ laravel/ai
- [6] Port searchable tool catalogs and inspector route prompts from 0.x ↗ laravel/mcp
- [7] Mirror annotated tool parameters into client request headers ↗ laravel/mcp
- [8] Resolve Eloquent attributes built with Attribute::get() or new Attribute() ↗ laravel/surveyor
- [9] Type singular model relations as nullable ↗ laravel/surveyor
- [10] fix: Validate Facebook OIDC token nonce ↗ laravel/socialite
- [11] [13.x] feat: add closure support to wherePivot and orWherePivot ↗ laravel/framework
- [12] [13.x] feat: add orWhereKey and orWhereKeyNot to Eloquent Builder ↗ laravel/framework
- [13] [13.x] Add debounceable queued listeners ↗ laravel/framework
- [14] Allow some Redis commands to retry on transient failures ↗ laravel/framework