pub struct PrunRequest {
pub tokens_to_remove: usize,
pub memo: Option<String>,
}Expand description
A pending prun request the LLM submitted via prun or prun_with_memo.
Lifecycle:
PrunTool::execute()pushes one of these onto the sharedpendingqueue.- The agent loop drains the queue between turns (see
agent_loop/run.rs:424). - Each request is applied to
AgentContext.inrun_contextin submission order, producing aPrunRecordevent that the session recorder captures.
tokens_to_remove is an upper bound — the loop walks the tail of inrun_context
removing whole entries until at least this many tokens have been freed. User
messages are never affected (they live in the separate user_context stream).
Fields§
§tokens_to_remove: usizeLower bound on tokens to remove from the tail of inrun_context. The loop
rounds up to the nearest whole entry so a single message is never split.
memo: Option<String>Optional summary inserted in place of pruned content. Some for the
prun_with_memo variant; None for the silent prun variant.
Trait Implementations§
Source§impl Clone for PrunRequest
impl Clone for PrunRequest
Source§fn clone(&self) -> PrunRequest
fn clone(&self) -> PrunRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PrunRequest
impl RefUnwindSafe for PrunRequest
impl Send for PrunRequest
impl Sync for PrunRequest
impl Unpin for PrunRequest
impl UnsafeUnpin for PrunRequest
impl UnwindSafe for PrunRequest
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
Mutably borrows from an owned value. Read more