#[non_exhaustive]pub enum ToolEvent {
Progress(ToolCallUpdateFields),
Completed(ToolCallUpdateFields),
Failed(ToolError),
}Expand description
Elements of the event stream produced by Tool::execute.
Terminal semantics: the stream contains at most one ToolEvent::Completed or
ToolEvent::Failed, and it must be the last event in the stream. When the main
loop encounters a terminal event, it considers the tool call finished and does not
consume any further elements.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Progress(ToolCallUpdateFields)
Progress delta: the main loop forwards this as a tool_call_update in an ACP
session/update.
Contains only the fields that changed, matching the “patch” semantics of
ToolCallUpdateFields.
Completed(ToolCallUpdateFields)
Successful completion. fields contains the remaining final-state fields (e.g.,
final content, locations, raw_output); the main loop is responsible for setting
status to Completed.
Failed(ToolError)
Terminal failure. Carries the Rust-side error so the caller can retry or log it;
when mapping to ACP, the main loop sets status to Failed and places the
ToolError text into content.