pub struct AgentHarnessConfig {Show 22 fields
pub max_tool_calls_per_turn: usize,
pub max_tool_wall_clock_secs: u64,
pub max_tool_retries: u32,
pub max_parallel_tool_calls: usize,
pub auto_compaction_enabled: bool,
pub auto_compaction_threshold_tokens: Option<u64>,
pub auto_compaction_instructions: Option<String>,
pub auto_compaction_pause_after: bool,
pub compact_on_model_switch: bool,
pub tool_result_clearing: ToolResultClearingConfig,
pub max_budget_usd: Option<f64>,
pub budget_warning_threshold: f64,
pub continuation_policy: ContinuationPolicy,
pub context_reset_mode: ContextResetMode,
pub context_reset_stall_threshold: u32,
pub event_log_path: Option<String>,
pub orchestration_mode: HarnessOrchestrationMode,
pub max_revision_rounds: usize,
pub confidence_escalation: ConfidenceEscalationConfig,
pub skeptic_panel: SkepticPanelConfig,
pub verification: VerificationAutoRecoveryConfig,
pub continuation: TrackerContinuationConfig,
/* private fields */
}Fields§
§max_tool_calls_per_turn: usizeMaximum number of tool calls allowed per turn. Defaults to 120.
Set to 0 to disable the cap.
max_tool_wall_clock_secs: u64Maximum wall clock time (seconds) for tool execution in a turn
max_tool_retries: u32Maximum retries for retryable tool errors
max_parallel_tool_calls: usizeMaximum number of tool calls that may execute concurrently within a single parallel batch.
Set to 0 to disable the cap (unlimited concurrency). Default: 4.
auto_compaction_enabled: boolEnable automatic context compaction when token pressure crosses threshold.
Enabled by default. When disabled, normal threshold-triggered automatic compaction is skipped; the bounded post-tool recovery path may still compact the older prefix as a safety fallback after a provider failure.
auto_compaction_threshold_tokens: Option<u64>Optional absolute compaction threshold (tokens) for native and local compaction.
When set, this may lower the trigger but cannot bypass the resolved
model capacity or context.max_context_tokens safety ceiling.
The next response budget is reserved before deriving the trigger.
auto_compaction_instructions: Option<String>Optional custom instructions for the compaction summarization prompt. When set, replaces the default Anthropic compaction prompt entirely. Useful for tool-use scenarios to prevent the model from calling tools during summarization. Only applies to Anthropic provider.
auto_compaction_pause_after: boolWhether to pause after compaction (Anthropic only).
When true and compaction triggers, the API returns early with
stop_reason: "compaction" and only the compaction block.
The caller can then insert additional messages before the model
generates its text response.
compact_on_model_switch: boolAutomatically compact conversation context when the main session model or provider is switched mid-conversation, so the newly selected model starts from a summary instead of the outgoing model’s raw trace. Default: true. Disable to keep the full history across a model switch.
tool_result_clearing: ToolResultClearingConfigProvider-native tool-result clearing policy. When enabled, old tool
results are stripped from the context once it grows past
trigger_tokens, protecting recent results and assistant tool-call batches
and always retaining at least clear_at_least_tokens. This bounds
per-turn context growth and is enabled by default.
max_budget_usd: Option<f64>Optional maximum estimated API cost in USD before VT Code stops the session.
budget_warning_threshold: f64Fraction of max_budget_usd at which VT Code emits a one-time
near-budget warning. Ignored when max_budget_usd is unset.
continuation_policy: ContinuationPolicyControls whether harness-managed continuation loops are enabled.
context_reset_mode: ContextResetModeWhen to trigger a context reset — starting a clean session from
external artifacts only, discarding conversation history. Distinct
from compaction (which preserves conversational continuity).
Default: off (carry forward history as before).
context_reset_stall_threshold: u32Number of consecutive stall turns before on_stall context reset
triggers. Ignored unless context_reset_mode = "on_stall".
Default: 2.
event_log_path: Option<String>Optional compatibility/export JSONL path for harness events. Canonical events are always stored under the workspace session store; unset configuration creates no global harness file.
orchestration_mode: HarnessOrchestrationModeSelect the exec/full-auto harness orchestration path.
max_revision_rounds: usizeMaximum generator revision rounds after evaluator rejection.
confidence_escalation: ConfidenceEscalationConfigConfidence-based escalation for autonomous decisions.
Implements the escalation decision rule: Escalate iff p_success < tau_conf OR action in A_irreversible OR cost > B_auto
When a tool call is classified as irreversible or below the confidence threshold, the harness escalates to blocked-handoff instead of proceeding autonomously. Opt-in (default: disabled).
skeptic_panel: SkepticPanelConfigAdversarial multi-model evaluator panel. When enabled, the harness runs the evaluator prompt against every listed model in parallel and aggregates the strictest verdict/scorecard across the panel. Opt-in (default: disabled).
verification: VerificationAutoRecoveryConfigAutonomous recovery for the anti-blind-editing verification gate.
When the model emits text instead of running a verifier, the harness
grants bounded directive retries and (optionally) runs the detected
project verifier itself instead of forcing manual continue.
continuation: TrackerContinuationConfigTracker-aware auto-continuation: when task_tracker still has
incomplete steps, keep looping / auto-queue the next turn instead of
ending and nudging the user to resume.
Trait Implementations§
Source§impl Clone for AgentHarnessConfig
impl Clone for AgentHarnessConfig
Source§impl Debug for AgentHarnessConfig
impl Debug for AgentHarnessConfig
Source§impl Default for AgentHarnessConfig
impl Default for AgentHarnessConfig
Source§impl<'de> Deserialize<'de> for AgentHarnessConfig
impl<'de> Deserialize<'de> for AgentHarnessConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for AgentHarnessConfig
impl JsonSchema for AgentHarnessConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more