Agent Event
Since
0.3.0-beta01
Inheritors
Types
Fired when generation is aborted via AbortSignal before it finishes. Carries the steps completed up to the abort.
Each individual stream chunk, alongside the step it belongs to.
Generation finished. output is the typed agent output (was Any?); experimentalContext is the typed context after any prepareStep override (was Any?). messages is the final accumulated message list, for resuming after a tool-approval pause without re-walking the events.
After one step's model call streamed to completion.
Before one step's model call — the EXACT prepared params sent to the provider.
A span sub-event (name + attributes), emitted via TelemetryActiveSpan.addEvent.
Generation started. options is the typed agent context (was Any?).
Fired before each loop step's model call, AFTER prepareCall + prepareStep have resolved it. request carries the EXACT prepared params (system prompt, tool subset, sampler overrides); priorSteps are the accumulated step results (priorSteps[i] is step i+1's outcome, empty on step 1). Both required — the event fires only once the params exist.
Fired immediately after a tool's executor returns or throws. Carries an owned typed outcome instead of paired nullable success/error fields.
Fired immediately before a tool's executor runs. Carries the parsed tool call envelope and the messages-list snapshot so observers can record context.