pub struct SessionOpenOptions {Show 63 fields
pub additional_content_exclusion_policies: Option<Vec<SessionOpenOptionsAdditionalContentExclusionPolicy>>,
pub additional_directories: Option<Vec<String>>,
pub agent_context: Option<String>,
pub allow_all_mcp_server_instructions: Option<bool>,
pub ask_user_disabled: Option<bool>,
pub auth_info: Option<Value>,
pub available_tools: Option<Vec<String>>,
pub capi: Option<CapiSessionOptions>,
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_citations: Option<bool>,
pub enable_file_change_tracking: Option<bool>,
pub enable_managed_settings: Option<bool>,
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 events_log_includes_subagents: Option<bool>,
pub excluded_builtin_agents: Option<Vec<String>>,
pub excluded_tools: Option<Vec<String>>,
pub feature_flags: Option<HashMap<String, bool>>,
pub included_builtin_agents: Option<Vec<String>>,
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 session_limits: Option<SessionLimitsConfig>,
pub shell: Option<ShellOptions>,
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 verbosity: Option<Verbosity>,
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.
additional_directories: Option<Vec<String>>Additional directories the agent may access beyond the working directory. Each entry is granted to the session’s file-access allow-list and surfaced to the model (system prompt context and @-mention completion). Absolute paths are recommended; a relative path is resolved against the session’s working directory. Nonexistent or unresolvable entries are skipped with a warning. This is applied on both session creation and resume, and is not persisted: a resumed session that omits this option does not retain previously supplied directories (re-supply them, exactly as the CLI re-passes --add-dir).
agent_context: Option<String>Runtime context discriminator for agent filtering.
allow_all_mcp_server_instructions: Option<bool>Whether to include instructions from every MCP server in the system prompt instead of only allowlisted servers.
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.
capi: Option<CapiSessionOptions>Options scoped to the built-in CAPI (Copilot API) provider.
client_kind: Option<String>Structured client kind used for runtime behavior gates.
client_name: Option<String>Identifier of the client driving the session.
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_citations: Option<bool>Experimental: enable native model citations (Anthropic models today), normalized onto the assistant.message event. Off by default; may change or be removed while the citations surface is experimental.
Experimental. This type is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases.
enable_file_change_tracking: Option<bool>Opt in to capturing file changes for session rewind and session diff. Capture cannot reconstruct changes made before it was enabled. On create it starts capture from the first turn. It is also honored on resume: for a session that already has tracked prior turns, tracking continues automatically even if this is omitted; passing it on resume additionally enables tracking for an eligible session that has no prior root turn yet. Resuming a session whose prior root turns were never tracked has no restorable baseline, so tracking stays disabled for it and rewind reports file change tracking as unavailable; the resume itself still succeeds, so sessions that predate tracking remain loadable. The opt-in is only rejected when the session can never track (a subagent session, or one without local session storage). It is intentionally absent from the mutable options update because enabling it after edits have occurred would create an incomplete, misleading baseline. Subagents share the parent session’s capture store and are not tracked as separate rewind points: a file a subagent writes is attributed to whichever root user turn was open when the capture was staged, just before the tool body ran. A turn cannot open while a staged capture is still in flight, so a subagent tool that staged under the spawning turn stays attributed to it however late the write lands, while a capture it stages after the user’s next message belongs to that later turn. Attribution decides which turn’s rewind point counts and file preview include that write; it does not narrow which rewinds revert it, because a rewind restores every capture from the selected turn onward, so the earlier spawning turn reverts it as well.
enable_managed_settings: Option<bool>Opt-in: self-fetch and enforce enterprise managed settings at session bootstrap.
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.
events_log_includes_subagents: Option<bool>Whether subagent callback events should be forwarded into the session event log sink.
excluded_builtin_agents: Option<Vec<String>>Built-in subagent names to exclude from this session. Excluded built-ins are hidden from agent discovery and cannot be dispatched unless a custom agent with the same name is available.
excluded_tools: Option<Vec<String>>Denylist of tool names.
feature_flags: Option<HashMap<String, bool>>Feature-flag values resolved by the host.
included_builtin_agents: Option<Vec<String>>Built-in subagent names to include in this session. When specified, only these built-ins are available, subject to runtime availability and exclusions. Custom agents with the same name remain available.
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.
session_limits: Option<SessionLimitsConfig>Initial session limits.
shell: Option<ShellOptions>Per-session settings for built-in shell tools.
shell_process_flags: Option<Vec<String>>PowerShell process flags applied to built-in and user-requested shell commands.
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.
verbosity: Option<Verbosity>Initial output verbosity level for supported models.
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
impl Clone for SessionOpenOptions
Source§fn clone(&self) -> SessionOpenOptions
fn clone(&self) -> SessionOpenOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more