pub struct UtilityScoringConfig {
pub enabled: bool,
pub threshold: f32,
pub gain_weight: f32,
pub cost_weight: f32,
pub redundancy_weight: f32,
pub uncertainty_bonus: f32,
pub exempt_tools: Vec<String>,
pub utility_window: usize,
pub high_gain_tools: Vec<String>,
}Expand description
Configuration for utility-guided tool dispatch.
Fields§
§enabled: boolEnable utility-guided gating. Default: false.
threshold: f32Minimum utility score required to execute a tool call. Default: 0.1.
gain_weight: f32Weight for the estimated gain component. Must be >= 0. Default: 1.0.
cost_weight: f32Weight for the step cost component. Must be >= 0. Default: 0.5.
redundancy_weight: f32Weight for the redundancy penalty. Must be >= 0. Default: 0.3.
uncertainty_bonus: f32Weight for the exploration bonus. Must be >= 0. Default: 0.2.
exempt_tools: Vec<String>Tool names that bypass the utility gate unconditionally.
utility_window: usizeConsecutive low-utility calls before early-stopping the loop. 0 = disabled.
Exempt tools (invoke_skill, load_skill) do not count toward this window.
The counter resets between outer loop iterations.
high_gain_tools: Vec<String>Tool names that always receive the 0.75 “direct action” gain tier, matching
diagnostics/edit/etc in the built-in default_gain table.
Opt-in override for tool ids the built-in table has no entry for — most notably
MCP-registered tools, whose ids are {server_id}_{name} (see
McpTool::sanitized_id) and therefore never match a hardcoded name. Without an
entry here, such a tool falls to the generic 0.5 bucket and can stall behind a
Retrieve -> redundant retry -> vetoed cycle on its first call (#5659). Default:
empty (no behavior change for existing configs).
Implementations§
Trait Implementations§
Source§impl Clone for UtilityScoringConfig
impl Clone for UtilityScoringConfig
Source§fn clone(&self) -> UtilityScoringConfig
fn clone(&self) -> UtilityScoringConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more