Skip to main content

Module plan_mode

Module plan_mode 

Source
Expand description

enter_plan_mode / exit_plan_mode tools — agent-driven read-only planning.

When the agent calls enter_plan_mode, the runtime sets an exploring flag that blocks any write tools until exit_plan_mode is called. exit_plan_mode clears the flag, emits a AgentEvent::PlanProposed event (so TUI/HTTP surfaces can render the review modal), and then blocks until the human reviewer calls PlanApprovalGate::approve or PlanApprovalGate::reject.

§Concurrency safety

PlanApprovalGate::wait_for_approval reads the response without holding a lock across any .await point, preventing deadlocks.

Structs§

EnterPlanModeTool
Tool that switches the agent into read-only planning mode.
ExitPlanModeTool
Tool that exits plan mode and presents the agent’s plan for human review.
PlanApprovalGate
Shared state for the agent-driven plan mode approval flow.
PlanModeRequestGate
Gate for the plan-mode pre-confirmation step.
RequestPlanModeTool
Tool that asks the user for permission before entering plan mode.

Enums§

PlanApprovalResult
The human reviewer’s decision on an agent-proposed plan.
PlanModeRequestResult
Decision result for the pre-confirmation step.