pub enum AgentEvent {
TextDelta(String),
ToolCallRequested {
tool_call_id: String,
name: String,
arguments: String,
},
ToolCallResult {
tool_call_id: String,
result: ToolResult,
},
TurnComplete,
Error(AgentError),
SkillTriggered {
name: String,
description: String,
},
AsyncToolCompleted {
task_id: String,
tool_call_id: String,
result: ToolResult,
},
}Expand description
Events pushed from Agent to Frontend.
Variants§
TextDelta(String)
Streaming text delta from LLM response.
ToolCallRequested
LLM requested a tool call. Frontend should display and optionally wait for confirmation.
ToolCallResult
Tool execution completed with result.
TurnComplete
Current turn is complete (LLM finished responding, no more tool calls).
Error(AgentError)
An error occurred during agent execution.
SkillTriggered
A skill was triggered. Frontend can display this as a system notice.
AsyncToolCompleted
An async background task finished (success, failure, or cancellation).
result is the final outcome, already reinjected into the conversation
as a system-notification message, and the LLM is being woken to act on
it. Frontends use this to update task-progress UI; no further action is
required for the conversation itself.
Task start is signalled by the regular ToolCallResult event whose
result.is_pending is true (with result.pending_task_id set).