pub struct ToolResultClearingConfig {
pub enabled: bool,
pub trigger_tokens: u64,
pub keep_tool_uses: u32,
pub keep_recent_tool_batches: u32,
pub clear_at_least_tokens: u64,
pub clear_tool_inputs: bool,
}Fields§
§enabled: boolEnables native or request-only local clearing; set false to opt out.
Durable history and events retain full outputs.
trigger_tokens: u64Local clearing caps this at 60% of the provider/session history budget after output reserves and system/tool-schema overhead (minimum positive cap: 1). Lower configured triggers win; unknown capacity keeps this value. Configured values must be positive. Native edit thresholds keep the configured value.
keep_tool_uses: u32Protect newest results. Local clearing also retains all results from their originating assistant tool-call batches, matching call IDs across reordered completions and intervening directives.
keep_recent_tool_batches: u32Local clearing additionally protects the newest assistant messages with tool calls, selected by originating message order (default 2). Protection is the union with keep_tool_uses; 0 restores count-based batch retention. Native Anthropic context edits continue to use keep_tool_uses only.
clear_at_least_tokens: u64§clear_tool_inputs: boolReplace paired tool_calls[].function.arguments for stubbed results.
Leaving inputs in place keeps full apply_patch/write_file bodies on
every request after the result was already reclaimed. Defaults to
true; set false to opt out. Bare #[serde(default)] on a bool
is false, so this field names its default fn explicitly.
Trait Implementations§
Source§impl Clone for ToolResultClearingConfig
impl Clone for ToolResultClearingConfig
Source§impl Debug for ToolResultClearingConfig
impl Debug for ToolResultClearingConfig
Source§impl Default for ToolResultClearingConfig
impl Default for ToolResultClearingConfig
Source§impl<'de> Deserialize<'de> for ToolResultClearingConfig
impl<'de> Deserialize<'de> for ToolResultClearingConfig
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 ToolResultClearingConfig
impl JsonSchema for ToolResultClearingConfig
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