Expand description
Tool invocation state machine.
Tool calls have a lifecycle: streaming → waiting_confirmation → executing → completed
(with cancelled as a terminal alternative). Each transition arrives as a
SessionMessageDelta with a
tool_state_update field carrying the whole next state, not a patch.
§Wire format
Variant names serialize as snake_case to match the TS ToolPhase union
("streaming" / "waiting_confirmation" / "executing" / "completed"
/ "cancelled"). Inline variant fields serialize as camelCase to match
the TS interface shape (partialInput, approvalId, elapsedMs,
confirmedBy). The per-variant rename_all = "camelCase" attribute
handles the latter — a bare rename_all on the enum only affects
variant names, not their fields.
Structs§
- Tool
Info - Metadata for an in-flight or finished tool invocation, attached to a
SessionMessagewhenrole = tool_call.
Enums§
- Cancel
Reason - Confirmed
By - Tool
Phase - Phase name — useful as a lightweight discriminator when you don’t need the full state payload (e.g. to pick an icon).
- Tool
State - Tool state — a full replacement on each transition, never a delta.