Skip to main content

AgentConfig

Struct AgentConfig 

Source
pub struct AgentConfig {
Show 31 fields pub home_dir: PathBuf, pub model: String, pub max_iterations: u32, pub tool_delay_ms: u64, pub provider: String, pub base_url: Option<String>, pub api_key: Option<String>, pub compression: CompressionConfig, pub network: NetworkConfig, pub mcp_servers: Vec<McpServerConfig>, pub max_concurrent_requests: Option<usize>, pub security: SecurityConfig, pub memory_expiry: MemoryExpiryConfig, pub nudge_interval: u32, pub llm_max_retries: u32, pub llm_retry_base_ms: u64, pub platform: PlatformConfig, pub auto_skill_threshold: u32, pub llm_timeout_secs: u64, pub tool_timeout_secs: u64, pub shutdown_timeout_secs: u64, pub max_tokens_per_task: Option<u32>, pub max_output_tokens: Option<u32>, pub reasoning_effort: Option<ReasoningEffort>, pub context_window: Option<usize>, pub disabled_toolsets: Vec<String>, pub disabled_tools: Vec<String>, pub show_usage_footer: bool, pub platforms: WebhookPlatformsConfig, pub server: ServerConfig, pub cron: CronConfig,
}

Fields§

§home_dir: PathBuf§model: String§max_iterations: u32§tool_delay_ms: u64§provider: String§base_url: Option<String>§api_key: Option<String>§compression: CompressionConfig§network: NetworkConfig§mcp_servers: Vec<McpServerConfig>§max_concurrent_requests: Option<usize>§security: SecurityConfig§memory_expiry: MemoryExpiryConfig§nudge_interval: u32

Inject a memory-save reminder every N tool-use iterations within a task. 0 = disabled. Default: 5.

§llm_max_retries: u32

Max retry attempts on transient LLM API errors (429, 5xx, network). 0 = disabled.

§llm_retry_base_ms: u64

Base delay in milliseconds for exponential backoff between retries.

§platform: PlatformConfig

Platform-level access controls (whitelist, mention gate, session isolation).

§auto_skill_threshold: u32

Minimum tool-use iterations that trigger an automatic skill-reflection pass after a task. The agent reviews the conversation and calls write_skill if the workflow is reusable. Set to 0 to disable. Default: 5.

§llm_timeout_secs: u64

Timeout in seconds for a single LLM API call (chat or stream). 0 = no timeout. Default: 120.

§tool_timeout_secs: u64

Timeout in seconds applied to every non-terminal tool dispatch. 0 = no timeout. Default: 60.

§shutdown_timeout_secs: u64

Drain window in seconds for graceful shutdown — server waits this long for in-flight requests to complete before forcing exit. Default: 30.

§max_tokens_per_task: Option<u32>

Hard cap on total tokens (input + output) consumed by a single task. When exceeded the agent stops and returns what it has with a budget notice. None means no limit.

§max_output_tokens: Option<u32>

Maximum output tokens per LLM request. Default: 8192. Lower this for models with small context windows (e.g. 4096 for a 27k-ctx model).

§reasoning_effort: Option<ReasoningEffort>

Reasoning effort for supported models (Claude extended thinking, OpenAI o1/o3/o4). Set via config.yaml: reasoning_effort: medium

§context_window: Option<usize>

Maximum context window of the model in tokens. Used by the context compressor to decide when to summarise history. Defaults to 128 000. Set this to the actual limit for small-context models (e.g. context_window: 27168 for Qwen3-14B-AWQ on vLLM).

§disabled_toolsets: Vec<String>

Toolsets to disable. Removes all tools in the named toolset from every request, reducing context usage for small-context models. Available toolsets: web, files, terminal, memory, skills, agent, browser, git, notes, json, mcp Providers: anthropic, openrouter, vllm, ollama, bedrock, codex, thaillm Example: disabled_toolsets: [browser, git, notes, json, agent]

§disabled_tools: Vec<String>

Individual tools to disable by exact name. Useful when only some tools in a toolset need to be removed (e.g. disable image_read without removing the entire files toolset). Example: disabled_tools: [image_read, pdf_read, session_search]

§show_usage_footer: bool

Append a usage footer ([N iter | Xin Yout Ztok @ model]) to every agent response. Useful for debugging; usually unwanted on chat platforms where end users see the output. Default: false.

§platforms: WebhookPlatformsConfig

Per-platform webhook server settings (LINE, WhatsApp, generic webhook). Each entry sets enabled flag, listening port, and HTTP path. Tokens and secrets continue to be read from ~/.garudust/.env — never from yaml.

§server: ServerConfig

HTTP gateway server settings (port, …). Overridden by --port and GARUDUST_PORT env var.

§cron: CronConfig

Cron scheduler — recurring agent tasks plus the memory consolidation / expiry sweeps. CLI flags (--cron-jobs, --memory-cron, --memory-expiry-cron) and the corresponding env vars take precedence.

Implementations§

Source§

impl AgentConfig

Source

pub fn garudust_dir() -> PathBuf

Canonical ~/.garudust directory.

Source

pub fn load() -> Self

Load config from ~/.garudust/config.yaml + ~/.garudust/.env + environment.

Priority (highest first):

  1. Environment variables already set in the shell
  2. ~/.garudust/.env (set if not already present in env)
  3. ~/.garudust/config.yaml
  4. Built-in defaults
Source

pub fn save_yaml(&self) -> Result<()>

Save non-secret settings to ~/.garudust/config.yaml.

Source

pub fn set_env_var(home_dir: &Path, key: &str, value: &str) -> Result<()>

Write or update a KEY=VALUE line in ~/.garudust/.env.

Trait Implementations§

Source§

impl Clone for AgentConfig

Source§

fn clone(&self) -> AgentConfig

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 AgentConfig

Source§

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

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

impl Default for AgentConfig

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for AgentConfig

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 AgentConfig

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<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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,