pub struct LoopConfig<'a> {Show 14 fields
pub system: String,
pub tools: Vec<Tool>,
pub llm: LlmOpts,
pub stream_fn: StreamFn,
pub hooks: HooksSet,
pub steering: UnboundedReceiver<AgentMessage>,
pub follow_ups: UnboundedReceiver<AgentMessage>,
pub cancel: CancellationToken,
pub working_dir: PathBuf,
pub max_turns: usize,
pub parallel: bool,
pub compaction: CompactionPolicy,
pub ctx_snapshot: Sender<Vec<AgentMessage>>,
pub session: Option<&'a mut Session>,
}Fields§
§system: String§tools: Vec<Tool>§llm: LlmOpts§stream_fn: StreamFn§hooks: HooksSet§steering: UnboundedReceiver<AgentMessage>§follow_ups: UnboundedReceiver<AgentMessage>§cancel: CancellationToken§working_dir: PathBufWorking directory for tool execution (bash cwd, file resolution).
Plumbed explicitly so embeddings can run against a directory other
than the process cwd; an empty path falls back to current_dir().
max_turns: usizeMaximum number of LLM turns in a single run. A turn is one model call
plus the tool calls it produces. Caps a runaway tool loop (the model
re-issuing tool calls forever) that would otherwise run until cancelled;
the run ends on a completed turn boundary with StopReason::MaxTurns.
Counts every turn in the run, including follow-up-triggered ones.
parallel: boolRun concurrency-safe tool calls in one batch in parallel (see
crate::tool::TypedTool::parallel_safe). false forces the old
strictly-sequential behaviour.
compaction: CompactionPolicyWhen to auto-summarize the older prefix, and how much recent context to
keep (see crate::compaction).
ctx_snapshot: Sender<Vec<AgentMessage>>A read-only window onto the run’s context. The loop republishes the whole
ctx at each turn boundary (see run_loop) so the actor can answer a
mid-run GetHistory/SideAsk without the &mut the run holds.
session: Option<&'a mut Session>Optional session to persist each produced message to as it is pushed into context — incremental, so a crash mid-run loses at most the in-flight message instead of the whole turn.