Skip to main content

Overview

runStream() gives a PHP caller completed agent-loop checkpoints, while onEvent() receives lifecycle observations in source order. This is the Tell surface for worker progress, server-sent events, telemetry, and tool/inference debugging; it does not require parsing TOON, NDJSON, or a trace file. Consume the generator fully before getReturn(). In a durable run this is also the point at which Tell is allowed to publish the new conversation head.

Example

Key Points

  • A checkpoint represents a completed agent-loop step, not an arbitrary token.
  • TellEvent::source() is available when a caller intentionally needs provider- or framework-specific fields.
  • Event payloads can contain tool or provider data. Project sanitized telemetry deliberately instead of forwarding payloads blindly to logs.