Skip to main content

SessionOpenOptions

Struct SessionOpenOptions 

Source
pub struct SessionOpenOptions {
Show 52 fields pub additional_content_exclusion_policies: Option<Vec<SessionOpenOptionsAdditionalContentExclusionPolicy>>, pub agent_context: Option<String>, pub ask_user_disabled: Option<bool>, pub auth_info: Option<Value>, pub available_tools: Option<Vec<String>>, pub client_kind: Option<String>, pub client_name: Option<String>, pub coauthor_enabled: Option<bool>, pub config_dir: Option<String>, pub continue_on_auto_mode: Option<bool>, pub copilot_url: Option<String>, pub custom_agents_local_only: Option<bool>, pub detached_from_spawning_parent_engagement_id: Option<String>, pub detached_from_spawning_parent_session_id: Option<String>, pub disabled_instruction_sources: Option<Vec<String>>, pub disabled_skills: Option<Vec<String>>, pub enable_on_demand_instruction_discovery: Option<bool>, pub enable_script_safety: Option<bool>, pub enable_streaming: Option<bool>, pub env_value_mode: Option<SessionOpenOptionsEnvValueMode>, pub events_log_directory: Option<String>, pub excluded_tools: Option<Vec<String>>, pub feature_flags: Option<HashMap<String, bool>>, pub installed_plugins: Option<Vec<InstalledPlugin>>, pub integration_id: Option<String>, pub is_experimental_mode: Option<bool>, pub log_interactive_shells: Option<bool>, pub lsp_client_name: Option<String>, pub max_inline_binary_bytes: Option<i64>, pub memory: Option<MemoryConfiguration>, pub model: Option<String>, pub model_capabilities_overrides: Option<ModelCapabilitiesOverride>, pub models: Option<Vec<ProviderModelConfig>>, pub name: Option<String>, pub provider: Option<ProviderConfig>, pub providers: Option<Vec<NamedProviderConfig>>, pub reasoning_effort: Option<String>, pub reasoning_summary: Option<SessionOpenOptionsReasoningSummary>, pub remote_defaulted_on: Option<bool>, pub remote_exporting: Option<bool>, pub remote_steerable: Option<bool>, pub running_in_interactive_mode: Option<bool>, pub sandbox_config: Option<SandboxConfig>, pub session_capabilities: Option<Vec<SessionCapability>>, pub session_id: Option<SessionId>, pub shell_init_profile: Option<String>, pub shell_process_flags: Option<Vec<String>>, pub skill_directories: Option<Vec<String>>, pub skip_custom_instructions: Option<bool>, pub trajectory_file: Option<String>, pub working_directory: Option<String>, pub working_directory_context: Option<SessionContext>, /* private fields */
}
Expand description

Session construction options.

Experimental. This type is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases.

Fields§

§additional_content_exclusion_policies: Option<Vec<SessionOpenOptionsAdditionalContentExclusionPolicy>>

Additional content-exclusion policies to merge into the session policy set.

Experimental. This type is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases.

§agent_context: Option<String>

Runtime context discriminator for agent filtering.

§ask_user_disabled: Option<bool>

Whether ask_user is explicitly disabled.

§auth_info: Option<Value>

Initial authentication info for the session.

§available_tools: Option<Vec<String>>

Allowlist of available tool names.

§client_kind: Option<String>

Structured client kind used for runtime behavior gates.

§client_name: Option<String>

Identifier of the client driving the session.

§coauthor_enabled: Option<bool>

Whether commit-message coauthor trailers are enabled.

§config_dir: Option<String>

Override Copilot configuration directory.

§continue_on_auto_mode: Option<bool>

Whether auto-mode continuation is enabled.

§copilot_url: Option<String>

Override URL for the Copilot API endpoint.

§custom_agents_local_only: Option<bool>

Whether custom agents default to local-only execution.

§detached_from_spawning_parent_engagement_id: Option<String>

Parent engagement ID for detached child telemetry rollup.

§detached_from_spawning_parent_session_id: Option<String>

Parent session ID for detached child telemetry rollup.

§disabled_instruction_sources: Option<Vec<String>>

Instruction source IDs disabled for this session.

§disabled_skills: Option<Vec<String>>

Skill IDs disabled for this session.

§enable_on_demand_instruction_discovery: Option<bool>

Whether on-demand custom instruction discovery is enabled.

§enable_script_safety: Option<bool>

Whether shell-script safety heuristics are enabled.

§enable_streaming: Option<bool>

Whether model responses stream as delta events.

§env_value_mode: Option<SessionOpenOptionsEnvValueMode>

How MCP server environment values are interpreted.

§events_log_directory: Option<String>

Override directory for session event logs.

§excluded_tools: Option<Vec<String>>

Denylist of tool names.

§feature_flags: Option<HashMap<String, bool>>

Feature-flag values resolved by the host.

§installed_plugins: Option<Vec<InstalledPlugin>>

Installed plugins visible to the session.

§integration_id: Option<String>

Stable integration identifier for analytics.

§is_experimental_mode: Option<bool>

Whether experimental behavior is enabled.

§log_interactive_shells: Option<bool>

Whether interactive shell sessions are logged.

§lsp_client_name: Option<String>

Identifier sent to LSP-style integrations.

§max_inline_binary_bytes: Option<i64>

Maximum decoded byte size of a single inline model-facing binary tool result persisted in session events (default 10 MB).

§memory: Option<MemoryConfiguration>

Memory configuration for this session.

§model: Option<String>

Initial model identifier.

§model_capabilities_overrides: Option<ModelCapabilitiesOverride>

Initial model capability overrides.

§models: Option<Vec<ProviderModelConfig>>

BYOK model definitions added to the selectable model list, each referencing a provider name.

Experimental. This type is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases.

§name: Option<String>

Optional human-friendly session name.

§provider: Option<ProviderConfig>

Custom model-provider configuration (BYOK).

§providers: Option<Vec<NamedProviderConfig>>

Named BYOK provider connections, additive to CAPI auth. Combining with provider is rejected.

Experimental. This type is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases.

§reasoning_effort: Option<String>

Initial reasoning effort level.

§reasoning_summary: Option<SessionOpenOptionsReasoningSummary>

Initial reasoning summary mode for supported model clients.

§remote_defaulted_on: Option<bool>

Telemetry-only remote-defaulted flag.

§remote_exporting: Option<bool>

Telemetry-only remote exporting flag.

§remote_steerable: Option<bool>

Whether this session supports remote steering.

§running_in_interactive_mode: Option<bool>

Whether the host is an interactive UI.

§sandbox_config: Option<SandboxConfig>

Resolved sandbox configuration.

§session_capabilities: Option<Vec<SessionCapability>>

Capabilities enabled for this session.

§session_id: Option<SessionId>

Optional stable session identifier to use for a new session.

§shell_init_profile: Option<String>

Shell init profile.

§shell_process_flags: Option<Vec<String>>

Per-shell process flags.

§skill_directories: Option<Vec<String>>

Additional directories to search for skills.

§skip_custom_instructions: Option<bool>

Whether to skip custom instruction sources.

§trajectory_file: Option<String>

Optional trajectory output file path.

§working_directory: Option<String>

Working directory to anchor the session.

§working_directory_context: Option<SessionContext>

Pre-resolved working-directory context for session startup.

Trait Implementations§

Source§

impl Clone for SessionOpenOptions

Source§

fn clone(&self) -> SessionOpenOptions

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for SessionOpenOptions

Source§

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

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

impl Default for SessionOpenOptions

Source§

fn default() -> SessionOpenOptions

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

impl<'de> Deserialize<'de> for SessionOpenOptions

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for SessionOpenOptions

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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