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.
  • TellEventEnvelope::toArray() is the stable, redacted event contract for logs, queues, server-sent events, and telemetry.
  • Treat source events and raw payloads as in-process diagnostic details; do not forward them blindly across a process boundary.