Expand description
Dispatch trace records.
DispatchTrace is an additive, deterministic record of what happened
during a dispatch_tool_invocations_with_trace
call: each hook’s decision, the eventual invocation outcome, errors, and
reservation cleanups. Hosts use it to explain a tool-loop replay or to
export structured policy traces without depending on a concrete tracing
backend.
§Example
use rig_compose::{
DispatchTrace, ToolRegistry, dispatch_tool_invocations_with_trace,
};
let trace = DispatchTrace::new();
let _results =
dispatch_tool_invocations_with_trace(®istry, &invocations, &[], &trace).await?;
for event in trace.events() {
tracing::debug!(?event, "dispatch trace event");
}Structs§
- Dispatch
Trace - Append-only collector for
DispatchTraceEventvalues.
Enums§
- Dispatch
Trace Event - One observable event within a dispatch trace. Events are pushed in order;
invocation_indexandhook_indexrefer to positions in the slices passed todispatch_tool_invocations_with_trace. - Traced
Action - Lightweight projection of
ToolDispatchActionsuitable for trace recording. Decouples the trace shape from the runtime action enum so adding fields toToolDispatchActiondoes not silently widen trace records. - Traced
Outcome - Final outcome recorded for one invocation.