pub struct ConfirmationConfig {
pub tool_patterns: Vec<String>,
pub session_id: String,
pub register: RegisterConfirmation,
pub clear: ClearConfirmation,
}Expand description
Hooks the runner needs to wire write-confirmation HITL into a turn
without depending on AppState directly (keeps the runner unit-testable).
When Some, the runner installs a core ConfirmationHook over every tool
whose name matches one of tool_patterns. When such a
tool is about to run, the agent loop parks inside the hook’s pre_call
and emits a HumanRequest::Confirm; the runner’s bridge:
- calls
registerwith the session’sHumanResponsesender, so a laterconfirm_tool_actioncan resume, - emits a
confirm_tool_action_requiredevent through the turn sink.
On confirm_tool_action, the handler feeds the sender HumanResponse and
the parked tool either executes (approved) or is skipped with a rejection
result (denied). None (the default) installs no hook → no tool ever parks →
behavior is byte-for-byte identical to before HITL.
Fields§
§tool_patterns: Vec<String>Tool-name substrings that require human approval (matched by core’s
ConfirmationHook, which uses contains matching). Empty disables HITL.
session_id: StringThe session this turn belongs to — carried on the
confirm_tool_action_required event and the registration key so the
inbound confirm_tool_action (keyed by sessionId) routes back here.
register: RegisterConfirmationRegisters the parked turn’s HumanResponse sender under
session_id (typically AppState::register_confirmation).
clear: ClearConfirmationClears any registered sender for session_id when the
turn ends (typically AppState::clear_confirmation), so a stale sender
can’t mis-route a later confirmation.
Auto Trait Implementations§
impl !RefUnwindSafe for ConfirmationConfig
impl !UnwindSafe for ConfirmationConfig
impl Freeze for ConfirmationConfig
impl Send for ConfirmationConfig
impl Sync for ConfirmationConfig
impl Unpin for ConfirmationConfig
impl UnsafeUnpin for ConfirmationConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request