AgentConfig

Struct AgentConfig 

Source
pub struct AgentConfig {
Show 38 fields pub provider: String, pub api_key_env: String, pub default_model: String, pub theme: String, pub system_prompt_mode: SystemPromptMode, pub tool_documentation_mode: ToolDocumentationMode, pub enable_split_tool_results: bool, 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 refine_temperature: f32, 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_slash_commands: AgentCustomSlashCommandsConfig, pub custom_api_keys: BTreeMap<String, String>, pub checkpointing: AgentCheckpointingConfig, pub vibe_coding: AgentVibeCodingConfig, pub max_task_retries: u32, pub include_temporal_context: bool, pub temporal_context_use_utc: bool, pub include_working_directory: bool, pub user_instructions: Option<String>, pub default_editing_mode: EditingMode, pub require_plan_confirmation: bool, pub autonomous_mode: bool, pub circuit_breaker: CircuitBreakerConfig,
}
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

§system_prompt_mode: SystemPromptMode

System prompt mode controlling verbosity and token overhead Options: minimal (~500-800 tokens), lightweight (~1-2k), default (~6-7k), specialized (~7-8k) Inspired by pi-coding-agent: modern models often perform well with minimal prompts

§tool_documentation_mode: ToolDocumentationMode

Tool documentation mode controlling token overhead for tool definitions Options: minimal (~800 tokens), progressive (~1.2k), full (~3k current) Progressive: signatures upfront, detailed docs on-demand (recommended) Minimal: signatures only, pi-coding-agent style (power users) Full: all documentation upfront (current behavior, default)

§enable_split_tool_results: bool

Enable split tool results for massive token savings (Phase 4) When enabled, tools return dual-channel output:

  • llm_content: Concise summary sent to LLM (token-optimized, 53-95% reduction)
  • ui_content: Rich output displayed to user (full details preserved) Applies to: grep_file, list_files, read_file, run_pty_cmd, write_file, edit_file Default: true (opt-out for compatibility), recommended for production use
§todo_planning_mode: bool§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)

§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

§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 VT 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_slash_commands: AgentCustomSlashCommandsConfig

Configuration for custom slash commands

§custom_api_keys: BTreeMap<String, String>

Provider-specific API keys captured from interactive configuration flows

§checkpointing: AgentCheckpointingConfig

Checkpointing configuration for automatic turn snapshots

§vibe_coding: AgentVibeCodingConfig

Vibe coding configuration for lazy/vague request support

§max_task_retries: u32

Maximum number of retries for agent task execution (default: 2) When an agent task fails due to retryable errors (timeout, network, 503, etc.), it will be retried up to this many times with exponential backoff

§include_temporal_context: bool

Include current date/time in system prompt for temporal awareness Helps LLM understand context for time-sensitive tasks (default: true)

§temporal_context_use_utc: bool

Use UTC instead of local time for temporal context (default: false)

§include_working_directory: bool

Include current working directory in system prompt (default: true)

§user_instructions: Option<String>

Custom instructions provided by the user via configuration

§default_editing_mode: EditingMode

Default editing mode: “edit” (default) or “plan” In “plan” mode, the agent is read-only and produces implementation plans. In “edit” mode, the agent can modify files and execute commands. Toggle with Shift+Tab or /plan command during a session. Codex-inspired: Encourages structured planning before execution.

§require_plan_confirmation: bool

Require user confirmation before executing a plan (HITL pattern) When true, exiting plan mode shows the implementation blueprint and requires explicit user approval before enabling edit tools. Options in confirmation dialog: Execute, Edit Plan, Cancel

§autonomous_mode: bool

Enable autonomous mode - auto-approve safe tools with reduced HITL prompts When true, the agent operates with fewer confirmation prompts for safe tools (read operations, grep_file, list_files, etc.) while still blocking dangerous operations. Toggle with /agent command during a session.

§circuit_breaker: CircuitBreakerConfig

Circuit breaker configuration for resilient tool execution Controls when the agent should pause and ask for user guidance due to repeated failures

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>,