#[non_exhaustive]pub struct RunnerConfig {Show 14 fields
pub app_name: String,
pub agent: Arc<dyn Agent>,
pub session_service: Arc<dyn SessionService>,
pub artifact_service: Option<Arc<dyn ArtifactService>>,
pub memory_service: Option<Arc<dyn Memory>>,
pub plugin_manager: Option<Arc<PluginManager>>,
pub run_config: Option<RunConfig>,
pub compaction_config: Option<EventsCompactionConfig>,
pub context_cache_config: Option<ContextCacheConfig>,
pub cache_capable: Option<Arc<dyn CacheCapable>>,
pub request_context: Option<RequestContext>,
pub cancellation_token: Option<CancellationToken>,
pub intra_compaction_config: Option<IntraCompactionConfig>,
pub intra_compaction_summarizer: Option<Arc<dyn BaseEventsSummarizer>>,
}Expand description
Configuration for constructing a Runner.
Use Runner::builder() for a compile-time-safe way to construct this.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.app_name: StringApplication name used for session scoping.
agent: Arc<dyn Agent>The root agent to execute.
session_service: Arc<dyn SessionService>Session persistence backend.
artifact_service: Option<Arc<dyn ArtifactService>>Optional artifact storage service.
memory_service: Option<Arc<dyn Memory>>Optional memory/RAG service.
plugin_manager: Option<Arc<PluginManager>>Optional plugin manager for lifecycle hooks.
run_config: Option<RunConfig>Optional run configuration (streaming mode, etc.) If not provided, uses default (SSE streaming)
compaction_config: Option<EventsCompactionConfig>Optional context compaction configuration. When set, the runner will periodically summarize older events to reduce context size sent to the LLM.
context_cache_config: Option<ContextCacheConfig>Optional context cache configuration for automatic prompt caching lifecycle.
When set alongside cache_capable, the runner will automatically create and
manage cached content resources for supported providers.
When cache_capable is set but this field is None, the runner
automatically uses ContextCacheConfig::default() (4096 min tokens,
600s TTL, refresh every 3 invocations).
cache_capable: Option<Arc<dyn CacheCapable>>Optional cache-capable model reference for automatic cache management. Set this to the same model used by the agent if it supports caching.
request_context: Option<RequestContext>Optional request context from the server’s auth middleware bridge.
When set, the runner passes it to InvocationContext so that
user_scopes() and user_id() reflect the authenticated identity.
cancellation_token: Option<CancellationToken>Optional cooperative cancellation token for externally managed runs.
intra_compaction_config: Option<IntraCompactionConfig>Optional intra-invocation compaction configuration. When set, the runner estimates token count before each agent run and triggers mid-invocation summarization when the threshold is exceeded.
intra_compaction_summarizer: Option<Arc<dyn BaseEventsSummarizer>>Optional summarizer for intra-invocation compaction.
Required when intra_compaction_config is set.