pub struct ExecContext {
pub token: CancellationToken,
pub progress: Sender<ProgressEvent>,
pub call_id: ToolCallId,
pub turn: TurnId,
pub workdir: PathBuf,
pub config: Arc<Config>,
pub model_id: String,
pub task_id: Option<String>,
pub safety_mode: SafetyMode,
pub intent: Option<String>,
pub classifier: Option<Arc<dyn AutoClassifier>>,
pub approval: Option<ApprovalBroker>,
}Expand description
What a ToolExecutor::execute() receives.
Fields§
§token: CancellationToken§progress: Sender<ProgressEvent>§call_id: ToolCallId§turn: TurnId§workdir: PathBuf§config: Arc<Config>Parent session’s app::Config. Needed by SubagentTool so the
child reducer uses the same Ollama host, reasoning prefs, MCP
servers, etc. Other tools don’t consult it — keeping it as a
typed field (rather than a global) means the dependency is
explicit in the signature.
model_id: StringParent session’s active model id (e.g. "anthropic/claude-opus-4-7").
Subagents inherit this so they hit the same provider.
task_id: Option<String>Durable daemon task that owns this tool call, when execution was launched through the runtime task queue.
safety_mode: SafetyModeEffective live safety mode for this call (from the session, not the
static config). The policy gate builds its PolicyEngine from this.
intent: Option<String>The user’s stated intent for the turn (latest user message), passed to the Auto-mode classifier so it can judge whether an action is aligned.
classifier: Option<Arc<dyn AutoClassifier>>LLM classifier for SafetyMode::Auto. Some only when the effective
mode is Auto and a provider is bound; the gate awaits it to resolve a
PolicyDecision::Classify. None ⇒ the gate fails safe (escalate).
approval: Option<ApprovalBroker>Inline-approval back-channel (interactive runs only). Some lets the
gate prompt the user and park until they answer; None (headless) falls
back to the out-of-band DB-approval flow.
Implementations§
Source§impl ExecContext
impl ExecContext
pub fn new( token: CancellationToken, progress: Sender<ProgressEvent>, call_id: ToolCallId, turn: TurnId, workdir: PathBuf, config: Arc<Config>, model_id: String, task_id: Option<String>, safety_mode: SafetyMode, intent: Option<String>, classifier: Option<Arc<dyn AutoClassifier>>, approval: Option<ApprovalBroker>, ) -> Self
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ExecContext
impl !UnwindSafe for ExecContext
impl Freeze for ExecContext
impl Send for ExecContext
impl Sync for ExecContext
impl Unpin for ExecContext
impl UnsafeUnpin for ExecContext
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> 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>
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>
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