pub struct AutoApproveConfig {
pub enabled: bool,
pub safe_commands: Vec<String>,
pub stall_threshold_seconds: u64,
pub approval_level: ApprovalLevelPreset,
pub approve_worktree_writes: Option<bool>,
}Expand description
Configuration for the supervisor auto-approval feature.
Auto-approval detects permission prompts in stalled agent panes via
tmux capture-pane, classifies the pending command, and dispatches the
BTab Down Enter keystroke sequence when the command matches the
whitelist.
Embedded as Option<AutoApproveConfig> on SupervisorConfig so
existing configs without an [supervisor.auto_approve] table continue
to round-trip identically.
Fields§
§enabled: boolMaster enable flag. When false, no detection or approval runs.
safe_commands: Vec<String>Project-specific safe-command prefixes appended to the built-in
defaults from
default_safe_commands().
stall_threshold_seconds: u64Threshold (in seconds) of last_seen staleness before an agent in
working status is treated as stalled by the poll loop.
approval_level: ApprovalLevelPresetCoarse policy preset applied on top of the explicit fields.
When the preset is Off, Self::enabled is forced to false by
Self::resolved. When the preset is Conservative, the effective
whitelist is the built-in defaults minus git push and curl
entries.
approve_worktree_writes: Option<bool>Whether filesystem write / edit / create prompts whose target path resolves inside the agent’s own worktree are auto-approved.
None (the absent default) resolves to true via
Self::approve_worktree_writes — worktrees are isolated, so
confining auto-approval to the worktree boundary is safe by
construction. Set to false to revert to the manual-prompt flow for
all file operations. Out-of-worktree paths always require manual
approval regardless of this flag.
Implementations§
Source§impl AutoApproveConfig
impl AutoApproveConfig
Sourcepub const MIN_STALL_THRESHOLD_SECONDS: u64 = 5
pub const MIN_STALL_THRESHOLD_SECONDS: u64 = 5
Minimum stall threshold in seconds. Anything lower is clamped to avoid pathological poll loops.
Sourcepub fn resolved(&self) -> Self
pub fn resolved(&self) -> Self
Returns a copy of this config with preset rules applied and the stall threshold floor enforced.
- When
approval_level == Off,enabledis forced tofalse. - When
stall_threshold_seconds < MIN_STALL_THRESHOLD_SECONDS, the value is clamped and a warning is written to stderr.
Sourcepub fn approve_worktree_writes(&self) -> bool
pub fn approve_worktree_writes(&self) -> bool
Returns whether worktree-confined file operations are auto-approved.
Resolves the optional Self::approve_worktree_writes field to its
effective boolean: an absent value (the common case — no
[supervisor.auto_approve] section, or the field omitted) defaults to
true.
Sourcepub fn effective_whitelist(&self) -> Vec<String>
pub fn effective_whitelist(&self) -> Vec<String>
Returns the effective whitelist for this config, applying the preset
to the union of built-in defaults and user-configured safe_commands.
OffandSafeboth return defaults plus configured extras.Conservativereturns the same union withgit pushand anycurlentries filtered out.
Trait Implementations§
Source§impl Clone for AutoApproveConfig
impl Clone for AutoApproveConfig
Source§fn clone(&self) -> AutoApproveConfig
fn clone(&self) -> AutoApproveConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AutoApproveConfig
impl Debug for AutoApproveConfig
Source§impl Default for AutoApproveConfig
impl Default for AutoApproveConfig
Source§impl<'de> Deserialize<'de> for AutoApproveConfig
impl<'de> Deserialize<'de> for AutoApproveConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for AutoApproveConfig
Source§impl PartialEq for AutoApproveConfig
impl PartialEq for AutoApproveConfig
Source§fn eq(&self, other: &AutoApproveConfig) -> bool
fn eq(&self, other: &AutoApproveConfig) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for AutoApproveConfig
impl Serialize for AutoApproveConfig
impl StructuralPartialEq for AutoApproveConfig
Auto Trait Implementations§
impl Freeze for AutoApproveConfig
impl RefUnwindSafe for AutoApproveConfig
impl Send for AutoApproveConfig
impl Sync for AutoApproveConfig
impl Unpin for AutoApproveConfig
impl UnsafeUnpin for AutoApproveConfig
impl UnwindSafe for AutoApproveConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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