pub struct SamplingConfig {
pub coalesce_window_ms: u64,
pub coalesce_max_requests: u32,
}Expand description
v0.9.0 P4d: coalesce knobs for SamplingCoordinator (in
solo-api::llm::sampling_coordinator). Persisted under
[sampling] in solo.config.toml.
Plan §4 P4d names: coalesce_window_ms (default 5000) +
coalesce_max_requests (default 10). These collapse N
concurrent per-cluster sampling calls (from the
triples_batch_timer) into ONE coalesced peer.create_message,
surfacing ONE approval prompt per coalesce window in the user’s
MCP client instead of N.
Bypass for non-sampling backends: SamplingCoordinator is wired
only when [llm] mode = "mcp_sampling". For Ollama / Anthropic /
None, requests pass through to the underlying LlmClient
unchanged.
Fields§
§coalesce_window_ms: u64Upper bound (in milliseconds) the coordinator waits before flushing a non-empty buffer. Plan §4 P4d default: 5000.
coalesce_max_requests: u32Buffer size that triggers an immediate flush regardless of the window timer. Plan §4 P4d default: 10.
Implementations§
Source§impl SamplingConfig
impl SamplingConfig
Sourcepub fn diagnostic(&self) -> SamplingConfigDiagnostic
pub fn diagnostic(&self) -> SamplingConfigDiagnostic
v0.9.1 P1 Fix 5 (m3): classify the resolved settings without
emitting any log line. Pure function; pinned by
[tests::sampling_config_diagnostic_classifies_edge_values].
Sourcepub fn warn_on_edge_values(&self)
pub fn warn_on_edge_values(&self)
v0.9.1 P1 Fix 5 (m3): inspect the resolved settings and emit operator-visible warnings for edge values that disable coalescing without an outright error.
The coordinator’s with_settings constructor clamps
coalesce_max_requests via max_batch.max(1), and a zero
coalesce_window_ms makes the buffered-timer flush
immediately — together they collapse the coordinator to a
pass-through. That’s a legitimate operator choice (e.g. for
debugging or to surface every approval prompt individually),
so we don’t reject — but it’s surprising enough that v0.9.0
shipped without any signal, which led to the m3 audit finding.
Called from SoloConfig::read at startup so the warning lands
in the daemon log once at process boot.
Trait Implementations§
Source§impl Clone for SamplingConfig
impl Clone for SamplingConfig
Source§fn clone(&self) -> SamplingConfig
fn clone(&self) -> SamplingConfig
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 SamplingConfig
impl Debug for SamplingConfig
Source§impl Default for SamplingConfig
impl Default for SamplingConfig
Source§impl<'de> Deserialize<'de> for SamplingConfig
impl<'de> Deserialize<'de> for SamplingConfig
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 PartialEq for SamplingConfig
impl PartialEq for SamplingConfig
Source§fn eq(&self, other: &SamplingConfig) -> bool
fn eq(&self, other: &SamplingConfig) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for SamplingConfig
impl Serialize for SamplingConfig
impl Eq for SamplingConfig
impl StructuralPartialEq for SamplingConfig
Auto Trait Implementations§
impl Freeze for SamplingConfig
impl RefUnwindSafe for SamplingConfig
impl Send for SamplingConfig
impl Sync for SamplingConfig
impl Unpin for SamplingConfig
impl UnsafeUnpin for SamplingConfig
impl UnwindSafe for SamplingConfig
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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 more