pub struct AutoProcessContext<'a> {
pub tool_id: &'a str,
pub tool_args: Value,
pub session_id: &'a str,
pub abort: Option<Receiver<bool>>,
pub on_progress: Option<Box<dyn Fn(ProcessProgress) + Send + Sync>>,
pub provider: Arc<dyn Provider>,
pub model: String,
pub bus: Option<SessionBus>,
pub trace_id: Option<Uuid>,
pub subcall_provider: Option<Arc<dyn Provider>>,
pub subcall_model: Option<String>,
}Expand description
Context for auto-processing.
§Observability model
Two orthogonal streams describe an RLM run:
crate::rlm::context_trace::ContextTrace(durable): the full, ordered record of every iteration, tool call, and model response. Attached to the returnedRlmResultso the JSONL flywheel and post-hoc analysis can replay a run exactly.- Session bus events (ephemeral):
SessionEvent::RlmProgressat every iteration start and a single terminalSessionEvent::RlmCompleteat exit. Subscribers see the run as it happens but are not expected to reconstruct full history from the bus — for that, consume the trace onRlmResult.
§Opting out of observability
Leaving bus and trace_id as None opts the call site out of
both bus emission and upstream trace correlation. This is
correct for tests, one-shot CLI runs, and synchronous utility
paths, but production call sites should thread an AppState-owned
bus through so the TUI and audit log see the activity.
Fields§
§tool_id: &'a strIdentifier of the tool whose output is being analysed (e.g.
"grep", "bash", or "session_context" for compaction).
tool_args: ValueJSON-encoded arguments that produced the tool output.
session_id: &'a strSession ID for logging / correlation.
abort: Option<Receiver<bool>>Optional abort signal — when Some(true) the loop exits early
and emits RlmOutcome::Aborted.
on_progress: Option<Box<dyn Fn(ProcessProgress) + Send + Sync>>Optional progress callback. Retained for backward compatibility;
prefer subscribing to SessionEvent::RlmProgress via bus.
provider: Arc<dyn Provider>Provider used for the root RLM model call.
model: StringModel identifier for the root RLM call.
bus: Option<SessionBus>Optional event bus for structured progress / completion events. See the struct-level docs for the bus-vs-trace split.
trace_id: Option<Uuid>Optional caller-supplied trace id so upstream events (e.g. a
compaction CompactionStarted) can be correlated with the
resulting RLM run. When None, a fresh id is generated and
returned on RlmResult::trace_id.
subcall_provider: Option<Arc<dyn Provider>>Pre-resolved provider for RLM sub-calls (iterations ≥ 2).
When None, all iterations use Self::provider. When set,
iteration 1 uses the root provider and subsequent iterations
use this provider, enabling “expensive model for analysis,
cheap model for continuation” splitting.
Resolution (and fallback-on-failure) is the caller’s
responsibility — see
Session::resolve_subcall_provider.
subcall_model: Option<String>Model identifier for the subcall provider. Mirrors
Self::subcall_provider: when None, all iterations use
Self::model.
Auto Trait Implementations§
impl<'a> Freeze for AutoProcessContext<'a>
impl<'a> !RefUnwindSafe for AutoProcessContext<'a>
impl<'a> Send for AutoProcessContext<'a>
impl<'a> Sync for AutoProcessContext<'a>
impl<'a> Unpin for AutoProcessContext<'a>
impl<'a> UnsafeUnpin for AutoProcessContext<'a>
impl<'a> !UnwindSafe for AutoProcessContext<'a>
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> 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