Repository navigation
v0.8.0
What's New
PausesLoop Support in PlanExecuteLoop
The PlanExecuteLoop now correctly detects and handles PausesLoop tool results during step execution. Previously, only the ReActLoop supported pausing when a tool required human interaction (e.g. an SDK app rendering an interactive iframe). This caused the plan-execute loop to keep running through remaining steps instead of pausing and waiting for user input.
The Problem
When using Plan & Execute mode with SDK app tools (like a Stamp Duty Calculator), the loop would:
- Execute the SDK app tool in step 1 — returning an iframe render payload
- Not pause — continue to steps 2, 3, 4... repeating the same instructions
- Eventually hit max steps, never rendering the interactive tool for the user
The Fix
Both planExecute() and planExecuteStream() now scan toolResults for PausesLoop instances (alongside the existing AskHumanSignal scan). When detected, the loop:
- Records the completed step and fires
afterStepcallback - Calculates deferred steps (remaining plan steps not yet executed)
- Fires the
pausecallback with the signal, deferred steps, step number, and response - Returns a
PlanResultwithpauseSignalanddeferredSteps
New APIs on PlanResult
pauseSignal— thePausesLoopinstance that caused the pause (nullwhen not paused)deferredSteps—list<string>of plan step descriptions not yet executedpaused()— returnstruewhen the loop was paused by aPausesLooptool resultcompleted()— now returnsfalsewhen paused (in addition toaskedHumanandreachedMaxSteps)
Usage
No code changes required — if your agent already uses PlanExecuteLoop with tools that implement PausesLoop, the loop will now correctly pause and return the signal.
$result = $agent->planExecute('Calculate stamp duty for NSW');
if ($result->paused()) {
// Emit the SDK render event to the frontend
$payload = json_decode((string) $result->pauseSignal, true);
// Remaining steps the agent needs to complete after user interaction
$deferred = $result->deferredSteps; // ['Record result', 'Advise client']
}Full Changelog: v0.7.0...v0.8.0