Skip to main content

Settings

Struct Settings 

Source
pub struct Settings {
Show 19 fields pub last_provider: ProviderKind, pub last_provider_url: Option<String>, pub last_model: Option<String>, pub preferred_mode: AgentMode, pub ollama_api_key: Option<String>, pub openai_compat_api_key: Option<String>, pub sockudo_app_id: Option<String>, pub sockudo_app_key: Option<String>, pub sockudo_app_secret: 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 skip_health_check: bool, pub safe_command_prefixes: Option<Vec<String>>, pub denied_command_prefixes: Option<Vec<String>>, pub project_md_files: 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_provider_url: Option<String>

Last URL used for the active provider. Set automatically by --config or by passing --url. Persisted so subsequent runs don’t re-prompt. (default: None)

§last_model: Option<String>§preferred_mode: AgentMode§ollama_api_key: Option<String>§openai_compat_api_key: Option<String>

API key sent as Authorization: Bearer <key> by the OpenAI-compatible provider (--openai-compat). Set via --api-key or OPENAI_API_KEY env var. Not used by Ollama, llama.cpp, vLLM, or Sockudo.

§sockudo_app_id: Option<String>

Sockudo app ID for the AI Transport provider.

§sockudo_app_key: Option<String>

Sockudo app key (used as auth_key in signed API requests and WebSocket URL).

§sockudo_app_secret: Option<String>

Sockudo app secret (used to sign API requests via HMAC-SHA256).

§ollama_timeout_secs: u64

Timeout in seconds for Ollama requests (default: 5)

§ollama_max_retries: u32

Maximum number of retries for Ollama requests (default: 3)

§ollama_think_type: OllamaThinkType

Controls the think/reasoning level for Ollama (default: Medium)

§show_thinking: bool

Show 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: bool

Automatically accept safe read-only commands in the run tool (default: true)

§skip_health_check: bool

Skip the provider health check at startup (default: false). Useful for the --openai-compat provider when the gateway requires a separate scope on /health, or for any server without a /health endpoint. When true, the agent proceeds straight to model selection and reports any connection error on the first real request instead.

§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)

§project_md_files: Option<Vec<String>>

Override the project instruction file discovery list. When set, replaces the hardcoded default list (TINYHARNESS.md, AGENTS.md, etc.). Use TINYHARNESS_MD_FILES env var for the highest priority override. (default: None → use hardcoded defaults)

Implementations§

Source§

impl Settings

Source

pub fn get_safe_commands(&self) -> Vec<String>

Returns the list of safe command prefixes, using defaults if not configured.

Source

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).

Trait Implementations§

Source§

impl Clone for Settings

Source§

fn clone(&self) -> Settings

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Settings

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Settings

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Settings

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Settings

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more