AgentConfig

Struct AgentConfig 

Source
pub struct AgentConfig {
Show 26 fields pub provider: String, pub api_key_env: String, pub default_model: String, pub theme: String, pub todo_planning_mode: bool, pub ui_surface: UiSurfacePreference, pub max_conversation_turns: usize, pub reasoning_effort: ReasoningEffortLevel, pub verbosity: VerbosityLevel, pub temperature: f32, pub max_tokens: u32, pub refine_temperature: f32, pub refine_max_tokens: u32, pub enable_self_review: bool, pub max_review_passes: usize, pub refine_prompts_enabled: bool, pub refine_prompts_max_passes: usize, pub refine_prompts_model: String, pub small_model: AgentSmallModelConfig, pub onboarding: AgentOnboardingConfig, pub project_doc_max_bytes: usize, pub instruction_max_bytes: usize, pub instruction_files: Vec<String>, pub custom_prompts: AgentCustomPromptsConfig, pub custom_api_keys: BTreeMap<String, String>, pub checkpointing: AgentCheckpointingConfig,
}
Expand description

Agent-wide configuration

Fields§

§provider: String

AI provider for single agent mode (gemini, openai, anthropic, openrouter, xai, zai)

§api_key_env: String

Environment variable that stores the API key for the active provider

§default_model: String

Default model to use

§theme: String

UI theme identifier controlling ANSI styling

§todo_planning_mode: bool

Enable TODO planning workflow integrations (update_plan tool, onboarding hints)

§ui_surface: UiSurfacePreference

Preferred rendering surface for the interactive chat UI (auto, alternate, inline)

§max_conversation_turns: usize

Maximum number of conversation turns before auto-termination

§reasoning_effort: ReasoningEffortLevel

Reasoning effort level for models that support it (none, low, medium, high) Applies to: Claude, GPT-5, GPT-5.1, Gemini, Qwen3, DeepSeek with reasoning capability

§verbosity: VerbosityLevel

Verbosity level for output text (low, medium, high) Applies to: GPT-5.1 and other models that support verbosity control

§temperature: f32

Temperature for main LLM responses (0.0-1.0) Lower values = more deterministic, higher values = more creative Recommended: 0.7 for balanced creativity and consistency Range: 0.0 (deterministic) to 1.0 (maximum randomness)

§max_tokens: u32

Maximum tokens for main LLM generation responses (default: 2000) Adjust based on model context window size:

  • 2000 for standard tasks
  • 16384 for models with 128k context
  • 32768 for models with 256k context
§refine_temperature: f32

Temperature for prompt refinement (0.0-1.0, default: 0.3) Lower values ensure prompt refinement is more deterministic/consistent Keep lower than main temperature for stable prompt improvement

§refine_max_tokens: u32

Maximum tokens for prompt refinement (default: 800) Prompts are typically shorter, so 800 tokens is usually sufficient

§enable_self_review: bool

Enable an extra self-review pass to refine final responses

§max_review_passes: usize

Maximum number of self-review passes

§refine_prompts_enabled: bool

Enable prompt refinement pass before sending to LLM

§refine_prompts_max_passes: usize

Max refinement passes for prompt writing

§refine_prompts_model: String

Optional model override for the refiner (empty = auto pick efficient sibling)

§small_model: AgentSmallModelConfig

Small/lightweight model configuration for efficient operations Used for tasks like large file reads, parsing, git history, conversation summarization Typically 70-80% cheaper than main model; ~50% of Claude Code’s calls use this tier

§onboarding: AgentOnboardingConfig

Session onboarding and welcome message configuration

§project_doc_max_bytes: usize

Maximum bytes of AGENTS.md content to load from project hierarchy

§instruction_max_bytes: usize

Maximum bytes of instruction content to load from AGENTS.md hierarchy

§instruction_files: Vec<String>

Additional instruction files or globs to merge into the hierarchy

§custom_prompts: AgentCustomPromptsConfig

Custom prompt configuration for slash command shortcuts

§custom_api_keys: BTreeMap<String, String>

Provider-specific API keys captured from interactive configuration flows

§checkpointing: AgentCheckpointingConfig

Checkpointing configuration for automatic turn snapshots

Implementations§

Source§

impl AgentConfig

Source

pub fn validate_llm_params(&self) -> Result<(), String>

Validate LLM generation parameters

Trait Implementations§

Source§

impl Clone for AgentConfig

Source§

fn clone(&self) -> AgentConfig

Returns a duplicate of the value. Read more
1.0.0 · 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 JsonSchema for AgentConfig

Source§

fn schema_name() -> String

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn is_referenceable() -> bool

Whether JSON Schemas generated for this type should be re-used where possible using the $ref keyword. 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> 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> 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> 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
Source§

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