pub enum CompactionReason {
Summarized,
Truncated,
}Expand description
Why a turn’s prompt was auto-compacted before it ran. The buffered analog
of WireCompactionReason, lifted to a closed Rust enum so surfaces match
on it without touching the wire crate.
Variants§
Summarized
Older turns were folded into an anchored-iterative summary (message-count trigger). The summary survives as the prompt’s preamble.
Truncated
Older tool-output payloads were trimmed to fit the token budget (char/token-budget trigger). No messages were dropped, only their bulk.
NOTE: the control plane no longer EMITS this reason — the retroactive tool-output truncation layer was removed in favor of token-budget summarization (the per-call tool-output cap now bounds individual tool results). This variant is retained as a never-emitted-on-happy-path decode path so any old persisted/wire value still maps (the enum stays exhaustive) and an unknown future wire reason has a quiet fallback.
Implementations§
Source§impl CompactionReason
impl CompactionReason
Sourcepub fn notice_headline(self, summarized_messages: u32) -> String
pub fn notice_headline(self, summarized_messages: u32) -> String
Canonical one-line headline (with a leading glyph) for a pre-turn
compaction notice, shared by every edge so the user-facing wording can’t
drift between Slack, Telegram, and the rest. summarized_messages is used
only by Self::Summarized. Returns PLAIN text — no markup — so each
surface applies its own emphasis/escaping (Slack _…_ mrkdwn, Telegram
*…*, …) without double-formatting.
Trait Implementations§
Source§impl Clone for CompactionReason
impl Clone for CompactionReason
Source§fn clone(&self) -> CompactionReason
fn clone(&self) -> CompactionReason
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for CompactionReason
Source§impl Debug for CompactionReason
impl Debug for CompactionReason
impl Eq for CompactionReason
Source§impl PartialEq for CompactionReason
impl PartialEq for CompactionReason
impl StructuralPartialEq for CompactionReason
Auto Trait Implementations§
impl Freeze for CompactionReason
impl RefUnwindSafe for CompactionReason
impl Send for CompactionReason
impl Sync for CompactionReason
impl Unpin for CompactionReason
impl UnsafeUnpin for CompactionReason
impl UnwindSafe for CompactionReason
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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§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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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