Explicit validation and repair of client tool-call/result pairing.
Accepts normalized Alloy.Message structs. Block keys may be atoms or
strings. Provider-owned server tools are left untouched. Call IDs must be
unique within a round; reuse in a later round is allowed.
repair/1 supplies error results for missing outcomes before the next
conversational message, or at the end. It preserves existing outcomes and
never executes tools. Duplicate, orphaned, or malformed calls/results are
ambiguous and cannot be repaired. Neither function runs automatically.
Summary
Functions
Supplies explicitly interrupted outcomes for missing results only.
Checks tool pairing, returning all detected issues.
Types
Functions
@spec repair([Alloy.Message.t()]) :: {:ok, [Alloy.Message.t()]} | {:error, [issue()]}
Supplies explicitly interrupted outcomes for missing results only.
@spec validate([Alloy.Message.t()]) :: :ok | {:error, [issue()]}
Checks tool pairing, returning all detected issues.