pub struct ContextControl { /* private fields */ }Implementations§
Source§impl ContextControl
impl ContextControl
pub fn new(branches: Arc<dyn ContextBranches>) -> Self
Sourcepub fn with_trim(self, trim: bool) -> Self
pub fn with_trim(self, trim: bool) -> Self
Trim old tool results before a threshold compaction (default on; ULTRON_COMPACTION_TRIM=off turns it off).
Sourcepub fn state(&self) -> Result<Value, String>
pub fn state(&self) -> Result<Value, String>
Forgotten, pinned and noted items of the root branch (ctx.state, the /rlm panel).
pub fn handle_request( &self, kind: &str, payload: &Map<String, Value>, lane: &str, ) -> Result<Value, String>
Source§impl ContextControl
impl ContextControl
Sourcepub fn tool_start(&self, lane: &str, tool_name: &str, tool_call_id: &str)
pub fn tool_start(&self, lane: &str, tool_name: &str, tool_call_id: &str)
Harness tool_start: a root rlm cell starts; finished tasks not yet attributed belong to it.
pub fn tool_end(&self, lane: &str, tool_call_id: &str)
Sourcepub fn message_end(&self, lane: &str, role: &str) -> Result<(), String>
pub fn message_end(&self, lane: &str, role: &str) -> Result<(), String>
Harness message_end: once the root model answered after a cell’s output, collapse it.
pub fn run_end(&self, lane: &str) -> Result<(), String>
Sourcepub fn task_ended(&self, task: &Value, cost: Option<f64>)
pub fn task_ended(&self, task: &Value, cost: Option<f64>)
A task’s terminal result is durable (NativeTask JSON). Root-level tasks are attributed to the root cell
that returns them.
Sourcepub fn entry_added(&self, lane: &str, entry: &Value) -> Option<Value>
pub fn entry_added(&self, lane: &str, entry: &Value) -> Option<Value>
Harness entry_added: drops a pending copy of the entry; for a context edit, the event observers receive.
Sourcepub fn before_compaction(
&self,
lane: &str,
reason: &str,
tokens_before: i64,
context_window: Option<i64>,
reserve_tokens: i64,
) -> Result<bool, String>
pub fn before_compaction( &self, lane: &str, reason: &str, tokens_before: i64, context_window: Option<i64>, reserve_tokens: i64, ) -> Result<bool, String>
Harness before_compaction: for a threshold compaction, trims tool results the model answered after when
that brings the estimate under 90% of the threshold; true declines the compaction.