pub enum ContextResetMode {
Off,
OnStall,
OnCompaction,
}Expand description
When to trigger a context reset — starting a clean session from external artifacts only, discarding conversation history to clear noise and bad assumptions. This is distinct from compaction, which preserves conversational continuity within the same task/agent loop.
Following the context engineering pattern: “Context reset uses external artifacts (files from note-taking, git logs, test results, task lists) as startup material to open a clean new context/session. It does not preserve the full conversation history, and can clear noise and bad assumptions so that a new agent can reorient itself.”
Variants§
Off
Never reset — always carry forward conversation history (current behavior).
OnStall
Reset when the progress monitor detects a stall (no forward progress for
context_reset_stall_threshold consecutive turns).
OnCompaction
Reset after every automatic compaction, so the post-compaction session starts from artifacts only rather than the compacted summary.
Implementations§
Trait Implementations§
Source§impl Clone for ContextResetMode
impl Clone for ContextResetMode
Source§impl Debug for ContextResetMode
impl Debug for ContextResetMode
Source§impl Default for ContextResetMode
impl Default for ContextResetMode
Source§impl<'de> Deserialize<'de> for ContextResetMode
impl<'de> Deserialize<'de> for ContextResetMode
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>,
impl Eq for ContextResetMode
Source§impl JsonSchema for ContextResetMode
impl JsonSchema for ContextResetMode
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for ContextResetMode
impl PartialEq for ContextResetMode
Source§impl Serialize for ContextResetMode
impl Serialize for ContextResetMode
impl StructuralPartialEq for ContextResetMode
Auto Trait Implementations§
impl Freeze for ContextResetMode
impl RefUnwindSafe for ContextResetMode
impl Send for ContextResetMode
impl Sync for ContextResetMode
impl Unpin for ContextResetMode
impl UnsafeUnpin for ContextResetMode
impl UnwindSafe for ContextResetMode
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<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.