pub struct TurnTracker {
pub started_at: Instant,
pub tool_calls_started: u32,
pub tool_calls_completed: u32,
pub tool_errors: u32,
pub files_read: BTreeSet<String>,
pub files_written: BTreeSet<String>,
pub files_created: BTreeSet<String>,
pub commands_run: Vec<String>,
pub searches: u32,
/* private fields */
}Expand description
Tracks tool calls, file accesses, and command runs during a single agent turn.
Designed to be reset at AgentStart and queried at any point during or
after the turn to drive progress indicators and summaries.
Fields§
§started_at: Instant§tool_calls_started: u32§tool_calls_completed: u32§tool_errors: u32§files_read: BTreeSet<String>Unique paths that were read (via the read tool).
files_written: BTreeSet<String>Unique paths that were written or edited (edit / multi_edit / write).
files_created: BTreeSet<String>Unique paths that were created by the write tool.
commands_run: Vec<String>Bash commands that were executed (first 80 chars each).
searches: u32Number of search-like tool calls (grep / find / probe_search / probe_extract).
Implementations§
Source§impl TurnTracker
impl TurnTracker
pub fn start_now(&mut self)
pub fn clear_counts(&mut self)
Sourcepub fn record_tool_start(
&mut self,
tool_call_id: &str,
name: &str,
args: &Value,
)
pub fn record_tool_start( &mut self, tool_call_id: &str, name: &str, args: &Value, )
Called at ToolExecutionStart. Records the tool call and classifies it.
The tool_call_id is stored so that record_tool_end can look up the
name when the result arrives.
Sourcepub fn record_tool_end(&mut self, tool_call_id: &str, is_error: bool)
pub fn record_tool_end(&mut self, tool_call_id: &str, is_error: bool)
Called at ToolExecutionEnd. Increments completed / error counters.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TurnTracker
impl RefUnwindSafe for TurnTracker
impl Send for TurnTracker
impl Sync for TurnTracker
impl Unpin for TurnTracker
impl UnsafeUnpin for TurnTracker
impl UnwindSafe for TurnTracker
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
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more