Skip to main content

SessionBuildOptions

Struct SessionBuildOptions 

Source
pub struct SessionBuildOptions {
Show 37 fields pub provider: Option<Provider>, pub self_hosted_server_id: Option<String>, pub output_schema: Option<OutputSchema>, pub structured_output_retries: u32, pub hooks_override: HookRunOverrides, pub comms_name: Option<String>, pub peer_meta: Option<PeerMeta>, pub resume_session: Option<Session>, pub budget_limits: Option<BudgetLimits>, pub provider_params: Option<Value>, pub external_tools: Option<Arc<dyn AgentToolDispatcher>>, pub recoverable_tool_defs: Option<Vec<ToolDef>>, pub blob_store_override: Option<Arc<dyn BlobStore>>, pub llm_client_override: Option<Arc<dyn Any + Send + Sync>>, pub override_builtins: ToolCategoryOverride, pub override_shell: ToolCategoryOverride, pub override_memory: ToolCategoryOverride, pub override_schedule: ToolCategoryOverride, pub override_mob: ToolCategoryOverride, pub schedule_tools: Option<Arc<dyn AgentToolDispatcher>>, pub preload_skills: Option<Vec<SkillId>>, pub realm_id: Option<String>, pub instance_id: Option<String>, pub backend: Option<String>, pub config_generation: Option<u64>, pub keep_alive: bool, pub checkpointer: Option<Arc<dyn SessionCheckpointer>>, pub silent_comms_intents: Vec<String>, pub max_inline_peer_notifications: Option<i32>, pub app_context: Option<Value>, pub additional_instructions: Option<Vec<String>>, pub shell_env: Option<HashMap<String, String>>, pub call_timeout_override: CallTimeoutOverride, pub resume_override_mask: ResumeOverrideMask, pub mob_tools: Option<Arc<dyn MobToolsFactory>>, pub runtime_build_mode: RuntimeBuildMode, pub mob_tool_authority_context: Option<MobToolAuthorityContext>,
}
Expand description

Optional build-time options used by factory-backed session builders.

Fields§

§provider: Option<Provider>§self_hosted_server_id: Option<String>§output_schema: Option<OutputSchema>§structured_output_retries: u32§hooks_override: HookRunOverrides§comms_name: Option<String>§peer_meta: Option<PeerMeta>§resume_session: Option<Session>§budget_limits: Option<BudgetLimits>§provider_params: Option<Value>§external_tools: Option<Arc<dyn AgentToolDispatcher>>§recoverable_tool_defs: Option<Vec<ToolDef>>

Serializable tool definitions used to reconstruct recoverable surface-owned dispatchers during session resume/rebuild.

§blob_store_override: Option<Arc<dyn BlobStore>>

Blob store used to externalize durable image content and hydrate refs back to bytes at execution seams.

§llm_client_override: Option<Arc<dyn Any + Send + Sync>>

Opaque transport for an optional per-request LLM override.

Factory builders may downcast this to their concrete client trait.

§override_builtins: ToolCategoryOverride§override_shell: ToolCategoryOverride§override_memory: ToolCategoryOverride§override_schedule: ToolCategoryOverride

Per-build override for the factory-level scheduler capability.

§override_mob: ToolCategoryOverride§schedule_tools: Option<Arc<dyn AgentToolDispatcher>>

Agent-facing scheduler tools supplied by the embedding surface.

Scheduler remains surface-owned. This dispatcher only controls tool visibility/composition for the built agent.

§preload_skills: Option<Vec<SkillId>>§realm_id: Option<String>§instance_id: Option<String>§backend: Option<String>§config_generation: Option<u64>§keep_alive: bool

Whether this session runs as a keep-alive (long-running, interrupt-to-stop) agent. Surfaces use this to decide blocking vs fire-and-return semantics.

§checkpointer: Option<Arc<dyn SessionCheckpointer>>

Optional session checkpointer for keep-alive persistence.

§silent_comms_intents: Vec<String>

Comms intents that should be silently injected into the session without triggering an LLM turn.

§max_inline_peer_notifications: Option<i32>

Maximum peer-count threshold for inline peer lifecycle context injection.

  • None: use runtime default
  • 0: never inline peer lifecycle notifications
  • -1: always inline peer lifecycle notifications
  • >0: inline only when post-drain peer count is <= threshold
  • <-1: invalid
§app_context: Option<Value>

Opaque application context passed through to custom SessionAgentBuilder implementations. Not consumed by the standard build pipeline.

Uses Value rather than Box<RawValue> because SessionBuildOptions must be Clone and Box<RawValue> does not implement Clone. Same tradeoff as provider_params.

§additional_instructions: Option<Vec<String>>

Additional instruction sections appended to the system prompt after skill assembly, before tool instructions. Order preserved.

§shell_env: Option<HashMap<String, String>>

Environment variables injected into shell tool subprocesses for this agent. Set by the application’s SessionAgentBuilder — never by the LLM. Values are not included in the agent’s context window.

§call_timeout_override: CallTimeoutOverride

Explicit call-timeout override at the build seam.

  • Inherit (default): defer to config override, then profile default
  • Disabled: explicitly disable call timeout regardless of profile
  • Value(d): explicitly set call timeout to d
§resume_override_mask: ResumeOverrideMask

Typed explicit-override intent for resumed-session merges.

Surfaces set bits only for fields they can prove were explicitly supplied by the caller. Resumed metadata then fills only the non-explicit fields.

§mob_tools: Option<Arc<dyn MobToolsFactory>>

Late-binding mob tool factory, called inside build_agent() with session-scoped args to produce the mob tool dispatcher.

Surfaces that enable mob tools pass an Arc<dyn MobToolsFactory> here. The factory calls MobToolsFactory::build_mob_tools during agent construction with the session ID, ops lifecycle registry, and optional comms runtime — then composes the result into the tool gateway.

§runtime_build_mode: RuntimeBuildMode

Runtime build mode — determines how the factory resolves the ops lifecycle registry and completion feed.

  • SessionOwned(bindings): runtime-backed build with epoch-owned bindings. Factory validates bindings.session_id == session.id().
  • StandaloneEphemeral: factory creates local-only ephemeral bindings. Suitable for WASM, tests, embedded, and standalone surfaces.
§mob_tool_authority_context: Option<MobToolAuthorityContext>

Runtime-injected mob operator authority context.

This is the only source of mob operator tool authority. Tool visibility may depend on this context being present, but dispatch-time authorization must still re-check the typed create/scope fields on every operator call.

Implementations§

Source§

impl SessionBuildOptions

Source

pub fn apply_persisted_mob_operator_access( &mut self, enable_mob: ToolCategoryOverride, persisted_authority_context: Option<MobToolAuthorityContext>, )

Apply the shared rehydration rule for mob operator access.

This preserves exact persisted authority when available and otherwise falls back to generated create-only authority for explicit mob enablement.

Source

pub fn apply_generated_create_only_mob_operator_access( &mut self, enable_mob: ToolCategoryOverride, )

Apply the shared host/runtime default for explicit mob operator enablement.

This keeps override_mob and the generated create-only authority context aligned at the composition seam. Existing-mob scope must be injected explicitly elsewhere; this helper never infers it.

Trait Implementations§

Source§

impl Clone for SessionBuildOptions

Source§

fn clone(&self) -> SessionBuildOptions

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SessionBuildOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SessionBuildOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more