pub struct AgentLoopConfig {Show 26 fields
pub model_id: String,
pub system_prompt: Option<String>,
pub temperature: f32,
pub max_tokens: u32,
pub tool_execution: ToolExecutionMode,
pub compaction_strategy: CompactionStrategy,
pub context_window: usize,
pub compaction_instruction: Option<String>,
pub session_id: Option<String>,
pub transport: Option<String>,
pub compact_on_start: bool,
pub max_retry_delay_ms: Option<u64>,
pub auto_retry_enabled: bool,
pub auto_retry_max_attempts: usize,
pub auto_retry_base_delay_ms: u64,
pub api_key: Option<String>,
pub workspace_dir: Option<PathBuf>,
pub provider_options: Option<ProviderOptions>,
pub on_compaction: Option<CompactionHook>,
pub snapshot_store: Option<Arc<dyn SnapshotStore>>,
pub memory: Option<Arc<dyn MemoryBackend>>,
pub url_resolver: Option<Arc<dyn UrlResolver>>,
pub todo: Option<Arc<dyn TodoStateProvider>>,
pub agent_pool: Option<Arc<dyn AgentPoolProvider>>,
pub lsp: Option<Arc<dyn LspProvider>>,
pub ttsr_engine: Option<Arc<TtsrEngine>>,
}Expand description
Configuration for an crate::AgentLoop instance.
Fields§
§model_id: StringModel identifier in provider/model format.
system_prompt: Option<String>Optional system prompt prepended to every request.
temperature: f32Sampling temperature (0.0 – 2.0).
max_tokens: u32Maximum tokens the model may generate per request.
tool_execution: ToolExecutionModeWhether tool calls run in parallel or sequentially.
compaction_strategy: CompactionStrategyCompaction strategy for managing context window usage.
context_window: usizeApproximate context window size in tokens.
compaction_instruction: Option<String>Optional instruction injected into the compaction prompt.
session_id: Option<String>Optional session identifier for logging and tracing.
transport: Option<String>Optional transport override (e.g. “sse”, “stdio”).
compact_on_start: boolWhether to trigger compaction before the first turn.
max_retry_delay_ms: Option<u64>Optional cap on retry back-off delay (milliseconds).
auto_retry_enabled: boolEnable automatic retry on retryable assistant errors.
auto_retry_max_attempts: usizeMaximum number of auto-retry attempts.
auto_retry_base_delay_ms: u64Base delay in milliseconds for auto-retry exponential back-off.
api_key: Option<String>API key override for the provider.
When set, this is injected into oxi_ai::StreamOptions so the
provider uses it instead of an environment variable.
workspace_dir: Option<PathBuf>Working directory for file tools. Defaults to current directory if None.
provider_options: Option<ProviderOptions>Per-provider options for fine-grained control.
Passed through to oxi_ai::StreamOptions::provider_options so the
provider can read provider-specific settings.
on_compaction: Option<CompactionHook>Async hook invoked after context compaction completes.
Unlike the Compaction event in the Fn callback, this hook is
async and its future is awaited within the agent loop. Errors are
logged at WARN level but don’t fail the loop.
Use this for side effects that require async I/O (e.g., persisting
compaction summaries to a memory store) without resorting to
tokio::spawn fire-and-forget.
snapshot_store: Option<Arc<dyn SnapshotStore>>Snapshot store for hashline edit mode.
memory: Option<Arc<dyn MemoryBackend>>Memory backend for memory tools.
url_resolver: Option<Arc<dyn UrlResolver>>URL resolver for internal protocol schemes.
todo: Option<Arc<dyn TodoStateProvider>>Todo state provider for the todo tool.
agent_pool: Option<Arc<dyn AgentPoolProvider>>Agent pool for Hub display.
lsp: Option<Arc<dyn LspProvider>>LSP provider for the lsp tool.
ttsr_engine: Option<Arc<TtsrEngine>>TTSR engine for stream rule checking.
Trait Implementations§
Source§impl Clone for AgentLoopConfig
impl Clone for AgentLoopConfig
Source§fn clone(&self) -> AgentLoopConfig
fn clone(&self) -> AgentLoopConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for AgentLoopConfig
impl !UnwindSafe for AgentLoopConfig
impl Freeze for AgentLoopConfig
impl Send for AgentLoopConfig
impl Sync for AgentLoopConfig
impl Unpin for AgentLoopConfig
impl UnsafeUnpin for AgentLoopConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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 moreimpl<T> MaybeSendSync for T
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.