pub struct ToolRequestContext {
pub provider: Arc<dyn ModelProvider>,
pub parent_model: Model,
pub parent_config: RunConfig,
pub cancel: CancellationToken,
pub event_sink: Option<Arc<dyn EventSink>>,
pub policy: Option<Arc<dyn ToolPolicy>>,
}Expand description
Inputs needed to build a single request’s tool list. Passed by value
into a ToolFactory so the factory can construct request-local tools
(e.g. a fresh top-level TaskTool bound to this run’s cancel token + sink).
The provider / parent_model / parent_config are the agent’s values
(the same for every request of that agent); only cancel + event_sink
vary per request. They are bundled together so the factory signature stays
a single argument.
Fields§
§provider: Arc<dyn ModelProvider>The model provider (shared, stateless — safe to reuse across requests).
parent_model: ModelThe parent agent’s model id. Inherited by subagents that omit their own.
parent_config: RunConfigThe parent agent’s run config. Inherited by subagents that omit their own.
cancel: CancellationTokenThis run’s cancellation token. Children inherit it via the TaskTool.
event_sink: Option<Arc<dyn EventSink>>This run’s event sink (OTel / tracing). Children emit to the same sink.
policy: Option<Arc<dyn ToolPolicy>>This run’s optional tool policy (Fae deviation; see the README).
Children inherit it via the TaskTool so a governance gate cannot be
bypassed by delegating to a subagent. None ⇒ allow-all.
Trait Implementations§
Source§impl Clone for ToolRequestContext
impl Clone for ToolRequestContext
Source§fn clone(&self) -> ToolRequestContext
fn clone(&self) -> ToolRequestContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more