Use onEvent to update product interfaces, write audit records, or connect agent activity to your existing telemetry.
Listen to a run
Keep event handlers small. Move slow network or storage work onto your application’s queue when it should not delay the run.
Event families
step.completed is emitted after the completed step has been checkpointed. This lets a persistence or telemetry consumer treat it as a stable boundary.
Choose events for a product interface
- Use model deltas from Streaming for live answer text.
- Use tool events for tool-call cards and progress indicators.
- Use
run.waiting_for_human to show approval or input controls.
- Use terminal run events to close loading states and record outcomes.
Last modified on July 26, 2026