#[non_exhaustive]pub struct TaskAgentConfig {Show 14 fields
pub max_iterations: u32,
pub system_prompt: Option<String>,
pub temperature: f32,
pub max_tokens: u32,
pub validation_config: Option<ValidationConfig>,
pub loop_detection: Option<LoopDetectionConfig>,
pub goal_revalidation_interval: Option<u32>,
pub max_replan_attempts: u32,
pub max_total_tokens: Option<u64>,
pub max_cost_usd: Option<f64>,
pub timeout_secs: Option<u64>,
pub allowed_files: Option<Vec<PathBuf>>,
pub plan_budget: Option<PlanBudget>,
pub context_budget_tokens: Option<u64>,
}Expand description
Configuration for a task agent.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.max_iterations: u32Maximum provider call iterations before the agent is forced to fail.
Default: 100 (high default to avoid artificial limits on complex tasks).
system_prompt: Option<String>Override the system prompt.
When None, crate::system_prompts::reasoning_agent_prompt is used.
temperature: f32Temperature for AI calls (0.0 – 1.0).
max_tokens: u32Maximum tokens for a single AI response.
validation_config: Option<ValidationConfig>Quality checks to run before accepting completion.
Set to None to disable validation entirely (useful in tests).
loop_detection: Option<LoopDetectionConfig>Loop detection settings. None disables. Default: 5-call window, enabled.
goal_revalidation_interval: Option<u32>Inject goal-reminder every N iterations. None disables. Default: Some(10).
max_replan_attempts: u32Abort after this many REPLAN cycles. Default: 3.
max_total_tokens: Option<u64>Abort when cumulative tokens reach this ceiling. Default: None.
max_cost_usd: Option<f64>Abort when cumulative cost (USD) reaches this ceiling. Default: None.
timeout_secs: Option<u64>Wall-clock timeout for the entire execute() call, in seconds. Default: None.
allowed_files: Option<Vec<PathBuf>>Per-agent file scope whitelist.
When Some, the agent receives a scope-violation error for any file
operation targeting a path that is not prefixed by at least one entry
in this list. When None, file access is unrestricted.
Uses Path::starts_with for prefix matching, which is
component-aware: "/src" allows "/src/main.rs" but denies
"/src_extra/file.txt".
plan_budget: Option<PlanBudget>Optional pre-execution budget check.
When Some, the agent asks the provider to produce a structured JSON
plan before starting execution. The plan is validated against the budget
constraints; if any constraint is exceeded the run fails immediately
with FailureCategory::PlanBudgetExceeded before any file or tool
side-effects occur.
Set to None (the default) to skip the planning phase entirely.
context_budget_tokens: Option<u64>Context budget in tokens.
When the estimated conversation token count exceeds this value,
the on_context_pressure
hook is called so the consumer can summarize or evict messages.
Only effective when lifecycle hooks are set on the AgentContext.
Default: None (no context pressure callbacks).
Trait Implementations§
Source§impl Clone for TaskAgentConfig
impl Clone for TaskAgentConfig
Source§fn clone(&self) -> TaskAgentConfig
fn clone(&self) -> TaskAgentConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more