Skip to content

The publication for web craftspeople Wednesday, 18 November 2026

AI for the web

Laravel AI SDK 1.4 Lets Agents Survive a Tool Failure

Laravel AI SDK 1.4, released November 13, now hands a failing tool's error back to the model instead of killing the run. Tool-approval testing and raw provider HTTP responses ship alongside it.

Laravel AI SDK 1.4 permet aux agents de survivre à l'échec d'un outil

The Laravel AI SDK moved to version 1.4 on November 13, 2026. The headline change is about agent resilience: an exception thrown inside a tool no longer kills the run outright. Instead, it’s passed back to the model as a failed tool result. The agent can then explain the problem or try a different approach instead of simply vanishing on the user.

The problem 1.4 fixes

Before this release, an exception thrown inside a tool immediately ended the run and fired the AgentFailed event. The model never saw the error’s content, so it had no chance to comment on it, work around it, or suggest an alternative tool. For a production agent wired into a flaky external API, this behavior turned a simple network hiccup into a full conversation breakdown.

What changes in 1.4

The SDK now passes the exception’s message back to the model as a failed tool result, letting the run continue normally. The exception still reaches the application’s exception handler, and the ToolFailed event still fires: nothing is hidden, the flow is simply made recoverable. One exception to the rule: an exception thrown by an event listener still fails the run, since it’s no longer a tool-level error in the strict sense.

BehaviorBefore 1.4Since 1.4
Exception inside a toolRun stops, AgentFailedRun continues, error returned to the model
ToolFailed eventFiredStill fired
OpenAI billing error (HTTP 429)RateLimitedExceptionInsufficientCreditsException, no retry
Classification / embedding / transcription responsesNo raw responseRaw HTTP response exposed

Testing tool approvals

Agent::fake() can now resume a paused tool approval: an approved tool runs and stores its result, a rejected tool gets a denied result back. That makes it possible to write end-to-end tests for agents that require human confirmation before acting, a common case for tools that touch billing or send emails.


$agent = Agent::fake()
    ->toolCallPaused('send_invoice', ['client_id' => 42]);

$response = $agent->run('Send the invoice to client 42');

$agent->assertToolCallApproved('send_invoice');
$response = $agent->approveToolCall('send_invoice');

$response->assertToolResult('send_invoice', fn ($result) => $result->ok());

Reading raw provider responses

Classification, embedding, transcription, image, and reranking responses now expose their raw HTTP response, as text responses already did. That makes it possible to read fields the SDK doesn’t map, such as the cost OpenRouter returns in usage.cost.

An exception inside a tool no longer stops the run: it becomes a result the model can read, comment on, and work around.

Migration to check: code that was catching RateLimitedException for OpenAI billing errors should now catch InsufficientCreditsException. Listeners relying on the fixed error event name for streaming errors, as well as those listening to agent events, should also filter on parentInvocationId to tell title-generation runs apart from normal runs.

Key takeaways

Laravel AI SDK 1.4 makes agents more tolerant of tool failures without hiding anything from existing exception handlers. The addition of approval testing and raw responses closes two gaps flagged since 1.1 shipped in October, in a still-young agentic tooling ecosystem where even the MCP specification keeps evolving. The AI for web developers reference guide places this change in the wider set of agentic tools available on the backend.

This is the kind of change you only notice once it’s missing. An agent that collapses at the first network hiccup from a third-party provider is a sign the tool was designed like a plain function call rather than what it actually is: a request that can fail for reasons entirely outside its control — Simon Janvier.

Further reading: the detailed Laravel AI SDK 1.4 announcement on Laravel News.

Read next