Skip to content

v0.8.0

Choose a tag to compare

@dalehurley dalehurley released this 18 Mar 07:32
· 1 commit to main since this release

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:

  1. Execute the SDK app tool in step 1 — returning an iframe render payload
  2. Not pause — continue to steps 2, 3, 4... repeating the same instructions
  3. 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 afterStep callback
  • Calculates deferred steps (remaining plan steps not yet executed)
  • Fires the pause callback with the signal, deferred steps, step number, and response
  • Returns a PlanResult with pauseSignal and deferredSteps

New APIs on PlanResult

  • pauseSignal — the PausesLoop instance that caused the pause (null when not paused)
  • deferredSteps — list<string> of plan step descriptions not yet executed
  • paused() — returns true when the loop was paused by a PausesLoop tool result
  • completed() — now returns false when paused (in addition to askedHuman and reachedMaxSteps)

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