Skip to content
providerkit
GitHub

AgentEvent

type AgentEvent =
| {
attemptId: string;
kind: "workflow" | "remote";
nodeId: string;
runId: string;
type: "execution_start";
version: string;
}
| {
attemptId: string;
operationId: string;
runId: string;
state: A2AState;
type: "remote_status";
}
| object &
| {
attempt: number;
kind: StepKind;
type: "step_start";
}
| {
data: unknown;
type: "step_progress";
}
| {
error?: StepError;
kind: StepKind;
status: "completed" | "retrying" | "failed";
type: "step_result";
}
| {
receipt: InputReceipt;
type: "input";
}
| object & HandoffReceipt
| {
attemptId: string;
kind: "model" | "tool";
operationId: string;
parentOperationId?: string;
previousAttemptId: string;
runId: string;
type: "operation_restart";
}
| {
attemptId: string;
chunk: ProviderChunk;
operationId: string;
runId: string;
type: "model_chunk";
}
| {
attemptId: string;
count: number;
operationId: string;
runId: string;
type: "images_omitted";
}
| {
request: PendingRequest;
type: "request";
}
| {
decision: Decision;
requestId: string;
type: "decision";
}
| {
request: ToolRequest;
type: "tool_start";
}
| {
request: ToolRequest;
result: ToolResult;
type: "tool_result";
}
| {
attemptId: string;
runId: string;
state: RunState;
type: "state";
}
| object &
| {
agentId: string;
kind: "agent" | "remote";
}
| {
kind: "workflow";
workflowId: string;
};

Defined in: agents/src/types.ts:1149

{
attemptId: string;
kind: "workflow" | "remote";
nodeId: string;
runId: string;
type: "execution_start";
version: string;
}

Portable start identity for nodes without agent lifecycle hooks. No host context or signal is serialized. Cached terminal nodes do not emit a new execution start.


{
attemptId: string;
operationId: string;
runId: string;
state: A2AState;
type: "remote_status";
}

object & | { attempt: number; kind: StepKind; type: "step_start"; } | { data: unknown; type: "step_progress"; } | { error?: StepError; kind: StepKind; status: "completed" | "retrying" | "failed"; type: "step_result"; }


{
receipt: InputReceipt;
type: "input";
}

Best-effort delivery update without the input’s content. The snapshot is authoritative.


object & HandoffReceipt

Sent before the target’s progress, also on resume. Upsert by operationId. Raw events remain server-only; project only the identities and labels your viewer may see.


{
attemptId: string;
kind: "model" | "tool";
operationId: string;
parentOperationId?: string;
previousAttemptId: string;
runId: string;
type: "operation_restart";
}

Replace the interrupted attempt’s partial display, do not append to it. Saved attempts are authoritative if this best-effort event is missed.


{
attemptId: string;
chunk: ProviderChunk;
operationId: string;
runId: string;
type: "model_chunk";
}

{
attemptId: string;
count: number;
operationId: string;
runId: string;
type: "images_omitted";
}

The request uses notes instead of these images because the model cannot read them. One count per affected model request. No image data or media ids leave through this event.


{
request: PendingRequest;
type: "request";
}

{
decision: Decision;
requestId: string;
type: "decision";
}

{
request: ToolRequest;
type: "tool_start";
}

{
request: ToolRequest;
result: ToolResult;
type: "tool_result";
}

{
attemptId: string;
runId: string;
state: RunState;
type: "state";
}

object & | { agentId: string; kind: "agent" | "remote"; } | { kind: "workflow"; workflowId: string; }

Names the specialist run a delegation is starting or resuming, before that run reports anything, so an observer can file the run’s events under its parent without reading ID formats. Best-effort progress like every other event: it can be missed, and it carries no status (the child’s own state event and the snapshot do). A child resumed after an approval or an interruption sends it again with the same identity, so upsert by runId. Only a child that runs here sends it: a settled child that is reused, or one the host serves from a saved copy, stays silent.