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 moreSource§impl Debug for UtilityScoringConfig
impl Debug for UtilityScoringConfig
Source§impl Default for UtilityScoringConfig
impl Default for UtilityScoringConfig
Source§fn default() -> UtilityScoringConfig
fn default() -> UtilityScoringConfig
Source§impl<'de> Deserialize<'de> for UtilityScoringConfigwhere
UtilityScoringConfig: Default,
impl<'de> Deserialize<'de> for UtilityScoringConfigwhere
UtilityScoringConfig: Default,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<UtilityScoringConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<UtilityScoringConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for UtilityScoringConfig
impl Serialize for UtilityScoringConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for UtilityScoringConfig
impl RefUnwindSafe for UtilityScoringConfig
impl Send for UtilityScoringConfig
impl Sync for UtilityScoringConfig
impl Unpin for UtilityScoringConfig
impl UnsafeUnpin for UtilityScoringConfig
impl UnwindSafe for UtilityScoringConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request