pub struct Settings {
pub last_provider: ProviderKind,
pub last_model: Option<String>,
pub preferred_mode: AgentMode,
pub ollama_api_key: Option<String>,
pub ollama_timeout_secs: u64,
pub ollama_max_retries: u32,
pub ollama_think_type: OllamaThinkType,
pub show_thinking: bool,
pub context_limit: Option<u32>,
pub auto_accept_safe_commands: bool,
pub safe_command_prefixes: Option<Vec<String>>,
pub denied_command_prefixes: Option<Vec<String>>,
}Expand description
Persisted application settings — pure data type with no I/O.
Use SettingsStore to load and save instances of this type.
Fields§
§last_provider: ProviderKind§last_model: Option<String>§preferred_mode: AgentMode§ollama_api_key: Option<String>§ollama_timeout_secs: u64Timeout in seconds for Ollama requests (default: 5)
ollama_max_retries: u32Maximum number of retries for Ollama requests (default: 3)
ollama_think_type: OllamaThinkTypeControls the think/reasoning level for Ollama (default: Medium)
show_thinking: boolShow the model’s thinking/reasoning chain inline during streaming (default: false)
context_limit: Option<u32>Context limit for warning calculations only (default: None, uses model default)
auto_accept_safe_commands: boolAutomatically accept safe read-only commands in the run tool (default: true)
safe_command_prefixes: Option<Vec<String>>List of command prefixes considered safe for auto-accept (default: see get_default_safe_commands)
denied_command_prefixes: Option<Vec<String>>List of command prefixes that are always denied auto-accept, even if they match a safe prefix. Takes priority over the safe list. (default: empty)
Implementations§
Source§impl Settings
impl Settings
Sourcepub fn get_safe_commands(&self) -> Vec<String>
pub fn get_safe_commands(&self) -> Vec<String>
Returns the list of safe command prefixes, using defaults if not configured.
Sourcepub fn get_denied_commands(&self) -> Vec<String>
pub fn get_denied_commands(&self) -> Vec<String>
Returns the list of always-denied command prefixes. These take priority over the safe list — if a command matches both a safe prefix and a denied prefix, it is denied. Defaults to an empty list (nothing denied).