pub struct CurrentToolExecution {
pub name: String,
pub timeout: Option<Duration>,
}Expand description
Snapshot of the tool currently executing inside the agent loop.
Populated by execute_single_tool immediately before
AgentTool::execute() is invoked and cleared on return (success, error,
or timeout). External consumers read it via the shared Arc<Mutex<...>>
installed on AgentLoopConfig::current_tool
— typically through the
BasicAgent::current_tool_timeout
delegate. Use case: emit a “pause-time estimate” upper bound when a host
pauses an in-flight session.
Single-tool model. The slot records the most-recently-started tool.
Under ToolExecutionStrategy::Parallel or Batched, concurrent tools
race on this slot: the last writer wins and the cleared state may briefly
reflect a sibling tool’s completion. This is intentional for the v0
pause-time-estimate use case (a single conservative upper bound suffices);
callers needing per-call granularity should subscribe to
AgentEvent::ToolExecutionStart / ToolExecutionEnd directly.
Fields§
§name: StringTool name (the same string the LLM emitted as Content::ToolCall.name).
timeout: Option<Duration>Effective timeout for the in-flight call (per-tool override → config-level → None).
Mirrors the resolution order in execute_single_tool.
Trait Implementations§
Source§impl Clone for CurrentToolExecution
impl Clone for CurrentToolExecution
Source§fn clone(&self) -> CurrentToolExecution
fn clone(&self) -> CurrentToolExecution
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more