pub struct PlanApprovalGate {
pub exploring_plan_mode: Arc<AtomicBool>,
pub pending_plan: Arc<RwLock<Option<String>>>,
/* private fields */
}Expand description
Shared state for the agent-driven plan mode approval flow.
A single Arc<PlanApprovalGate> is created in [AgentRuntimeBuilder::build]
and shared between:
EnterPlanModeTool— setsexploring_plan_modeExitPlanModeTool— clears flag, emits event, awaits decision- [
AgentRuntime] — callsapprove/reject RunCore— readsexploring_plan_modeto gate writes
Fields§
§exploring_plan_mode: Arc<AtomicBool>true while the agent is in exploring (read-only plan) mode.
pending_plan: Arc<RwLock<Option<String>>>The plan text currently pending review (set by ExitPlanModeTool).
Implementations§
Source§impl PlanApprovalGate
impl PlanApprovalGate
Sourcepub async fn wait_for_approval(&self) -> PlanApprovalResult
pub async fn wait_for_approval(&self) -> PlanApprovalResult
Block until the human reviewer sets a decision.
Reads the response without holding any lock across .await, preventing
deadlocks. On return the stored response is cleared so the gate can be
reused for the next exit_plan_mode call.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PlanApprovalGate
impl RefUnwindSafe for PlanApprovalGate
impl Send for PlanApprovalGate
impl Sync for PlanApprovalGate
impl Unpin for PlanApprovalGate
impl UnsafeUnpin for PlanApprovalGate
impl UnwindSafe for PlanApprovalGate
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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>
Converts
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>
Converts
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