Skip to main content

diff_tool_calls

Function diff_tool_calls 

Source
pub fn diff_tool_calls(a: &[RunEvent], b: &[RunEvent]) -> ToolCallDiff
Expand description

Diff two ordered RunEvent sequences, producing a ToolCallDiff that captures added, removed, reordered, and param-changed tool calls.

Events with kind == "tool_called" that lack a valid payload.tool_name string are silently skipped. Reorder detection uses the relative position of each tool call within the extracted tool-call stream (not the global run-level seq), so inserting or removing non-tool events between runs does not cause false positives.