pub struct ToolContext {
pub call_id: String,
pub name: String,
pub working_dir: PathBuf,
pub cancel: CancellationToken,
pub events: UnboundedSender<AgentEvent>,
pub session_path: Option<PathBuf>,
}Fields§
§call_id: String§name: String§working_dir: PathBuf§cancel: CancellationTokenThe run’s cancel token. A tool that needs clean-up must watch this and
finish BEFORE returning (e.g. bash kills its process group); the loop
only backstops a tool that ignores it, racing the call and recording a
synthetic error ToolResult (“aborted: cancelled before the tool
returned”) if the token fires first.
events: UnboundedSender<AgentEvent>§session_path: Option<PathBuf>The current run’s session transcript path, when it has one — None for
an in-memory session. session_search (scope:"current") reads it to
recover turns a compaction replaced with a summary.
Auto Trait Implementations§
impl Freeze for ToolContext
impl RefUnwindSafe for ToolContext
impl Send for ToolContext
impl Sync for ToolContext
impl Unpin for ToolContext
impl UnsafeUnpin for ToolContext
impl UnwindSafe for ToolContext
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