Skip to main content

AgentConfig

Struct AgentConfig 

Source
pub struct AgentConfig {
Show 50 fields pub provider: String, pub api_key_env: String, pub default_model: String, pub theme: String, pub system_prompt_mode: SystemPromptMode, pub max_system_prompt_tokens: u64, pub system_prompt_budget_warning: bool, pub trim_system_prompt: bool, pub tool_documentation_mode: ToolDocumentationMode, pub shell_prompt_profile: ShellPromptProfile, pub enable_split_tool_results: bool, pub todo_planning_mode: bool, pub ui_surface: UiSurfacePreference, pub max_conversation_turns: usize, pub idle_turn_limit: usize, pub reasoning_effort: ReasoningEffortLevel, pub allow_reasoning_effort_downgrade: bool, 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 prompt_suggestions: AgentPromptSuggestionsConfig, pub onboarding: AgentOnboardingConfig, pub project_doc_max_bytes: usize, pub project_doc_fallback_filenames: Vec<String>, pub instruction_max_bytes: usize, pub instruction_files: Vec<String>, pub instruction_excludes: Vec<String>, pub instruction_import_max_depth: usize, pub persistent_memory: PersistentMemoryConfig, pub custom_api_keys: BTreeMap<String, String>, pub credential_storage_mode: AuthCredentialsStoreMode, pub checkpointing: AgentCheckpointingConfig, pub vibe_coding: AgentVibeCodingConfig, pub max_task_retries: u32, pub harness: AgentHarnessConfig, pub codex_app_server: AgentCodexAppServerConfig, pub include_temporal_context: bool, pub temporal_context_use_utc: bool, pub include_working_directory: bool, pub include_structured_reasoning_tags: Option<bool>, pub user_instructions: Option<String>, pub require_plan_confirmation: bool, pub circuit_breaker: CircuitBreakerConfig, pub open_responses: OpenResponsesConfig,
}
Expand description

Agent-wide configuration

Fields§

§provider: String

Active provider for single-agent runs.

§api_key_env: String

Environment variable that stores the API key for the active provider

§default_model: String

Default model for new conversations.

§theme: String

UI theme identifier controlling ANSI styling

§system_prompt_mode: SystemPromptMode

System prompt mode controlling prompt verbosity and token overhead. Options target lean base prompts: minimal (~500 tokens), lightweight (~750 tokens), default and specialized (~900 tokens) before dynamic runtime addenda.

§max_system_prompt_tokens: u64

Soft token budget for the fully composed system prompt (character-based estimate, ~4 chars/token). Includes workspace instructions, guidelines, and runtime addenda on top of the base prompt.

§system_prompt_budget_warning: bool

Warn when the composed system prompt exceeds max_system_prompt_tokens.

§trim_system_prompt: bool

Trim low-priority advisory system prompt sections when over budget. Base, shell-safety, and active-tool contracts are never trimmed.

§tool_documentation_mode: ToolDocumentationMode

Tool documentation mode controlling token overhead for tool definitions Options: minimal, progressive (default, ~1.8k tokens for the builtin catalog), full Progressive: complete tool and parameter descriptions; only unusually long tails are trimmed at a sentence boundary (recommended) Minimal: first sentence of each tool description and no parameter descriptions (power users) Full: every tool and parameter description sent unmodified

§shell_prompt_profile: ShellPromptProfile

Shell syntax profile used in model-facing command examples. This controls prompt wording only; command policy remains in the runtime. Values: auto, unix_like, powershell.

§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: exec_command, code_search, apply_patch, and retained internal helpers Default: true (opt-out for compatibility), recommended for production use
§todo_planning_mode: bool

Enable TODO planning helper mode for structured task management

§ui_surface: UiSurfacePreference

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

§max_conversation_turns: usize

Maximum number of conversation turns before auto-termination

§idle_turn_limit: usize

Maximum consecutive idle turns (no tool calls, no meaningful response) before the agent runner treats the session as stalled and aborts the loop.

§reasoning_effort: ReasoningEffortLevel

Reasoning depth for capable models (none to max).

§allow_reasoning_effort_downgrade: bool

Permit a lower supported effort with an explicit harness diagnostic.

§verbosity: VerbosityLevel

Output verbosity for supported models (low to high).

§temperature: f32

Sampling temperature (0.0 precise to 1.0 creative).

§refine_temperature: f32

Temperature for prompt refinement (0.0-1.0).

§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

§prompt_suggestions: AgentPromptSuggestionsConfig

Inline prompt suggestion configuration for the chat composer

§onboarding: AgentOnboardingConfig

Session onboarding and welcome message configuration

§project_doc_max_bytes: usize

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

§project_doc_fallback_filenames: Vec<String>

Additional filenames to check when AGENTS.md is absent at a directory level.

§instruction_max_bytes: usize

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

§instruction_files: Vec<String>

Additional instruction files or globs to merge into the hierarchy

§instruction_excludes: Vec<String>

Instruction files or globs to exclude from AGENTS.md and rules discovery

§instruction_import_max_depth: usize

Maximum recursive @path import depth for instruction and rule files

§persistent_memory: PersistentMemoryConfig

Durable per-repository memory for main sessions

§custom_api_keys: BTreeMap<String, String>

Provider/key identities captured from interactive configuration flows

Note: Actual API keys are stored securely in the configured credential backend (OS keyring when available, otherwise encrypted file storage). Keys use <provider>/<environment-variable> identity keys and this field only tracks which identities have keys stored (for UI/migration purposes). The keys themselves are NOT serialized to the config file for security.

§credential_storage_mode: AuthCredentialsStoreMode

Preferred storage backend for credentials (OAuth tokens, API keys, etc.)

  • keyring: Use OS-specific secure storage (macOS Keychain, Windows Credential Manager, Linux Secret Service), with encrypted-file fallback when unavailable.
  • file: Use AES-256-GCM encrypted file with machine-derived key
  • auto: Try keyring first, fall back to file if unavailable
§checkpointing: AgentCheckpointingConfig

Checkpointing configuration for automatic turn snapshots

§vibe_coding: AgentVibeCodingConfig

Vibe coding configuration for lazy or 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

§harness: AgentHarnessConfig

Harness configuration for turn-level budgets, telemetry, and execution limits

§codex_app_server: AgentCodexAppServerConfig

Experimental Codex app-server sidecar configuration.

§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 in system prompts

§include_working_directory: bool

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

§include_structured_reasoning_tags: Option<bool>

Controls inclusion of the structured reasoning tag instructions block.

Behavior:

  • Some(true): always include structured reasoning instructions.
  • Some(false): never include structured reasoning instructions.
  • None (default): omit structured reasoning instructions in every prompt mode.

Models with native reasoning do not need visible reasoning tags, so the block is opt-in for users who want tag-based reasoning guidance.

§user_instructions: Option<String>

Custom instructions provided by the user via configuration to guide agent behavior

§require_plan_confirmation: bool

Require user confirmation before executing a plan generated in planning workflow When true, exiting planning workflow shows the implementation blueprint and requires explicit user approval before enabling edit tools.

§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

§open_responses: OpenResponsesConfig

Open Responses specification compliance configuration Enables vendor-neutral LLM API format for interoperable workflows

Implementations§

Source§

impl AgentConfig

Source

pub fn should_include_structured_reasoning_tags(&self) -> bool

Determine whether structured reasoning tag instructions should be included.

Trait Implementations§

Source§

impl Clone for AgentConfig

Source§

fn clone(&self) -> Self

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 JsonSchema for AgentConfig

Source§

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

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 inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being 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> 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> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

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

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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