pub struct AgentSessionConfig {Show 23 fields
pub agent: Option<Agent>,
pub provider: Option<Arc<dyn Provider>>,
pub session_manager: SessionManager,
pub settings_manager: SettingsManager,
pub cwd: String,
pub scoped_models: Vec<ScopedModel>,
pub initial_active_tool_names: Option<Vec<String>>,
pub allowed_tool_names: Option<Vec<String>>,
pub excluded_tool_names: Option<Vec<String>>,
pub tools: Vec<Arc<dyn AgentTool>>,
pub system_prompt: String,
pub model: Option<Model>,
pub thinking_level: ModelThinkingLevel,
pub messages: Vec<AgentMessage>,
pub extension_runner: Option<Arc<dyn ExtensionRunner>>,
pub host_extension_runner: Option<Arc<HostExtensionRunner>>,
pub model_runtime: Option<Arc<ModelRuntime>>,
pub compaction_stream_override: Option<CompactionStreamHandle>,
pub skills: Vec<Skill>,
pub prompt_templates: Vec<PromptTemplate>,
pub resource_loader: Option<DefaultResourceLoader>,
pub session_start_event: Option<SessionStartEvent>,
pub base_config: Option<AgentLoopConfig>,
}Expand description
Construction inputs for AgentSession.
The services factory builds this and passes it to AgentSession::new.
Product dependencies remain concrete: model_runtime is a typed handle,
while compaction test overrides use their own typed seam.
Fields§
§agent: Option<Agent>Pre-built agent. When None, AgentSession::new builds one from
provider + defaults and installs SessionHooks closures.
provider: Option<Arc<dyn Provider>>Provider used when agent is None.
session_manager: SessionManagerSession persistence manager (moved into an async mutex).
settings_manager: SettingsManagerSettings manager (owned; later slices mutate retry/compaction flags).
cwd: StringWorking directory.
scoped_models: Vec<ScopedModel>Scoped models from --models.
initial_active_tool_names: Option<Vec<String>>Initial active built-in tool names.
allowed_tool_names: Option<Vec<String>>Optional tool allowlist.
excluded_tool_names: Option<Vec<String>>Optional tool denylist.
tools: Vec<Arc<dyn AgentTool>>Initial tools installed on the agent when building from provider.
system_prompt: StringInitial system prompt.
model: Option<Model>Initial model (when building agent).
thinking_level: ModelThinkingLevelInitial thinking level.
messages: Vec<AgentMessage>Initial transcript messages.
extension_runner: Option<Arc<dyn ExtensionRunner>>Extension runner (defaults to NullExtensionRunner).
host_extension_runner: Option<Arc<HostExtensionRunner>>Concrete host runner retained for reload/restart (no trait downcast).
model_runtime: Option<Arc<ModelRuntime>>Typed model/auth runtime used by model selection and compaction.
compaction_stream_override: Option<CompactionStreamHandle>Optional compaction stream override for tests and headless integrations.
skills: Vec<Skill>Skills for /skill:name expansion (populated by resources slice).
prompt_templates: Vec<PromptTemplate>Prompt templates for /template expansion.
resource_loader: Option<DefaultResourceLoader>Resource loader retained for extension-driven resource refreshes.
session_start_event: Option<SessionStartEvent>Session-start metadata emitted to extensions on first bind
(None = default startup).
base_config: Option<AgentLoopConfig>Base agent loop config overrides (hooks are always installed by session).
Implementations§
Source§impl AgentSessionConfig
impl AgentSessionConfig
Sourcepub fn test_config(
provider: Arc<dyn Provider>,
model: Model,
) -> Result<Self, AgentSessionError>
pub fn test_config( provider: Arc<dyn Provider>, model: Model, ) -> Result<Self, AgentSessionError>
Minimal config for tests: in-memory session + null extensions.
SessionManager::in_memory with no custom id only fails if validation
is introduced later; the None options path is the documented default.
§Errors
Returns AgentSessionError::Session if both in-memory session
construction attempts fail.
Auto Trait Implementations§
impl !Freeze for AgentSessionConfig
impl !RefUnwindSafe for AgentSessionConfig
impl !UnwindSafe for AgentSessionConfig
impl Send for AgentSessionConfig
impl Sync for AgentSessionConfig
impl Unpin for AgentSessionConfig
impl UnsafeUnpin for AgentSessionConfig
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> 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 more