pub struct ToolStat {
pub name: String,
pub calls: u64,
pub errors: u64,
pub result_bytes: u64,
}Expand description
One tool’s tally: how many times it was called, how many of those calls did not succeed, and how many bytes its results fed the context.
errors counts every ToolResult { is_error: true } paired to this tool’s
ToolCall — INCLUDING the loop’s synthesized aborts for blocked/unexecuted
calls (loop_.rs:650 output: "aborted before execution",
fn synthesize_unexecuted at loop_.rs:798). So “error” here means the
call did not succeed, not the tool is buggy; v1 does not separate
“blocked by a hook” from “failed” (that would need a new transcript flag).
result_bytes = Σ ToolResult.output.len() — the honest stand-in for a
per-tool token count, which nothing records: ToolOutput has no token field
(tool.rs:23 pub struct ToolOutput { … fields end at tool.rs:35
pub path: Option<String>,) and usage is per TURN, provider-billed
(message.rs:21). It answers “which tool is eating my window?” without
inventing a number.
Fields§
§name: String§calls: u64§errors: u64§result_bytes: u64Trait Implementations§
Source§impl<'de> Deserialize<'de> for ToolStat
impl<'de> Deserialize<'de> for ToolStat
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ToolStat
impl StructuralPartialEq for ToolStat
Auto Trait Implementations§
impl Freeze for ToolStat
impl RefUnwindSafe for ToolStat
impl Send for ToolStat
impl Sync for ToolStat
impl Unpin for ToolStat
impl UnsafeUnpin for ToolStat
impl UnwindSafe for ToolStat
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.