pub enum HistoryMode {
CacheAware,
Rolling,
Off,
}Expand description
How the proxy prunes old tool results from conversation history.
Provider prompt caches (Anthropic cache_control, OpenAI automatic prompt
caching) bill cached prefix tokens at a fraction of the base rate but only
match exact prefixes. Any mutation whose position depends on the current
conversation length (a rolling window) rewrites a previously-stable message
every turn, invalidating the cache from that point — turning cheap cache
reads into full-price writes.
Variants§
CacheAware
Prune only at frozen generation boundaries that advance in large,
deterministic steps. Between jumps the request prefix is byte-stable,
so provider prompt caches keep hitting. Content the client has marked
with a cache_control breakpoint is never rewritten, so an advancing
boundary can no longer invalidate the already-cached prefix (#448).
Default.
Rolling
Legacy behaviour: summarize everything older than the last N messages. Maximum raw-token reduction, but defeats provider prompt caching.
Off
Never prune history (tool-result compression still applies — it is content-deterministic and therefore prefix-stable).
Trait Implementations§
Source§impl Clone for HistoryMode
impl Clone for HistoryMode
Source§fn clone(&self) -> HistoryMode
fn clone(&self) -> HistoryMode
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 HistoryMode
Source§impl Debug for HistoryMode
impl Debug for HistoryMode
impl Eq for HistoryMode
Source§impl PartialEq for HistoryMode
impl PartialEq for HistoryMode
impl StructuralPartialEq for HistoryMode
Auto Trait Implementations§
impl Freeze for HistoryMode
impl RefUnwindSafe for HistoryMode
impl Send for HistoryMode
impl Sync for HistoryMode
impl Unpin for HistoryMode
impl UnsafeUnpin for HistoryMode
impl UnwindSafe for HistoryMode
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§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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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