pub enum AgentMode {
Auto,
BypassPermissions,
Coding {
plan_approval: bool,
project_path: Option<PathBuf>,
},
Swarm {
parallelism: usize,
},
}Expand description
Agent execution mode.
Variants§
Auto
Auto: heuristic-based classification (default).
Short conversational messages skip planning. Longer or tool-requiring messages go through the Planning → Executing → Summarizing state machine.
BypassPermissions
Bypass all permission checks and approval steps — agent runs fully autonomously.
Equivalent to Claude Code’s --dangerously-skip-permissions. The agent:
- Never pauses for plan approval
- Executes all tool calls without confirmation
- Defaults to the heavy model (Opus) for maximum capability
- Always plans before executing
Only enable this in trusted, sandboxed environments or when you explicitly want autonomous unattended execution.
Coding
Coding mode: optimized for software development.
- Always plans before executing
- Prefers the heavy model (Opus) for execution
- Injects coding-specific rules into the system prompt
- When
plan_approvalis enabled, previews the plan to the user and waits for explicit confirmation before executing
Swarm
Swarm mode: deploy parallel coding agents.
The planner decomposes the task, then spawns up to parallelism
concurrent AgentRunner workers. Results are merged into a summary.
Implementations§
Source§impl AgentMode
impl AgentMode
pub fn is_coding(&self) -> bool
pub fn is_swarm(&self) -> bool
Sourcepub fn bypass_permissions(&self) -> bool
pub fn bypass_permissions(&self) -> bool
Whether all permission checks and approval steps should be skipped.
True for BypassPermissions and Coding { plan_approval: false }.
Sourcepub fn plan_approval(&self) -> bool
pub fn plan_approval(&self) -> bool
Whether to show a plan preview and wait for user approval before executing.
Always false in BypassPermissions mode even if plan_approval was set.
pub fn swarm_parallelism(&self) -> usize
Sourcepub fn system_prompt_injection(&self) -> Option<&'static str>
pub fn system_prompt_injection(&self) -> Option<&'static str>
System prompt section to inject when this mode is active.
Sourcepub fn prefer_heavy_model(&self) -> bool
pub fn prefer_heavy_model(&self) -> bool
Whether to prefer the heavy model for execution.
Sourcepub fn always_plan(&self) -> bool
pub fn always_plan(&self) -> bool
Whether to always plan (skip the conversational shortcut).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AgentMode
impl RefUnwindSafe for AgentMode
impl Send for AgentMode
impl Sync for AgentMode
impl Unpin for AgentMode
impl UnsafeUnpin for AgentMode
impl UnwindSafe for AgentMode
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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