Skip to main content

ResumeSessionConfig

Struct ResumeSessionConfig 

Source
#[non_exhaustive]
pub struct ResumeSessionConfig {
Show 87 fields pub session_id: SessionId, pub model: Option<String>, pub allowed_models: Option<Vec<String>>, pub client_name: Option<String>, pub reasoning_effort: Option<String>, pub reasoning_summary: Option<ReasoningSummary>, pub context_tier: Option<String>, pub streaming: Option<bool>, pub system_message: Option<SystemMessageConfig>, pub ask_user_variant: Option<AskUserVariant>, pub tools: Option<Vec<Tool>>, pub canvases: Option<Vec<CanvasDeclaration>>, pub canvas_handler: Option<Arc<dyn CanvasHandler>>, pub open_canvases: Option<Vec<OpenCanvasInstance>>, pub request_canvas_renderer: Option<bool>, pub request_extensions: Option<bool>, pub extension_sdk_path: Option<String>, pub extension_info: Option<ExtensionInfo>, pub canvas_provider: Option<CanvasProviderIdentity>, pub available_tools: Option<Vec<String>>, pub excluded_tools: Option<Vec<String>>, pub excluded_builtin_agents: Option<Vec<String>>, pub included_builtin_skills: Option<Vec<String>>, pub mcp_servers: Option<IndexMap<String, McpServerConfig>>, pub mcp_oauth_token_storage: Option<String>, pub auth_client_id_metadata_url: Option<String>, pub enable_config_discovery: Option<bool>, pub skip_embedding_retrieval: Option<bool>, pub embedding_cache_storage: Option<String>, pub organization_custom_instructions: Option<String>, pub enable_on_demand_instruction_discovery: Option<bool>, pub enable_file_hooks: Option<bool>, pub enable_host_git_operations: Option<bool>, pub enable_session_store: Option<bool>, pub enable_skills: Option<bool>, pub enable_mcp_apps: Option<bool>, pub github_mcp_tool_config: Option<GitHubMcpToolConfig>, pub skill_directories: Option<Vec<PathBuf>>, pub instruction_directories: Option<Vec<PathBuf>>, pub plugin_directories: Option<Vec<PathBuf>>, pub large_output: Option<LargeToolOutputConfig>, pub tool_search: Option<ToolSearchConfig>, pub disabled_skills: Option<Vec<String>>, pub disabled_mcp_servers: Option<Vec<String>>, pub hooks: Option<bool>, pub custom_agents: Option<Vec<CustomAgentConfig>>, pub default_agent: Option<DefaultAgentConfig>, pub agent: Option<String>, pub infinite_sessions: Option<InfiniteSessionConfig>, pub provider: Option<ProviderConfig>, pub capi: Option<CapiSessionOptions>, pub providers: Option<Vec<NamedProviderConfig>>, pub models: Option<Vec<ProviderModelConfig>>, pub enable_session_telemetry: Option<bool>, pub enable_citations: Option<bool>, pub enable_file_change_tracking: Option<bool>, pub session_limits: Option<SessionLimitsConfig>, pub model_capabilities: Option<ModelCapabilitiesOverride>, pub memory: Option<MemoryConfiguration>, pub config_directory: Option<PathBuf>, pub working_directory: Option<PathBuf>, pub additional_directories: Option<Vec<PathBuf>>, pub github_token: Option<String>, pub github_token_provider: Option<Arc<dyn GitHubTokenProvider>>, pub remote_session: Option<RemoteSessionMode>, pub include_sub_agent_streaming_events: Option<bool>, pub commands: Option<Vec<CommandDefinition>>, pub feature_flags: Option<HashMap<String, bool>>, pub enable_managed_settings: Option<bool>, pub managed_settings: Option<ManagedSettings>, pub session_fs_provider: Option<Arc<dyn SessionFsProvider>>, pub suppress_resume_event: Option<bool>, pub continue_pending_work: Option<bool>, pub permission_handler: Option<Arc<dyn PermissionHandler>>, pub elicitation_handler: Option<Arc<dyn ElicitationHandler>>, pub mcp_auth_handler: Option<Arc<dyn McpAuthHandler>>, pub user_input_handler: Option<Arc<dyn UserInputHandler>>, pub exit_plan_mode_handler: Option<Arc<dyn ExitPlanModeHandler>>, pub auto_mode_switch_handler: Option<Arc<dyn AutoModeSwitchHandler>>, pub hooks_handler: Option<Arc<dyn SessionHooks>>, pub system_message_transform: Option<Arc<dyn SystemMessageTransform>>, pub skip_custom_instructions: Option<bool>, pub custom_agents_local_only: Option<bool>, pub enable_experimental_mode: Option<bool>, pub coauthor_enabled: Option<bool>, pub manage_schedule_enabled: Option<bool>, pub event_buffer_capacity: Option<usize>, /* private fields */
}
Expand description

See SessionConfig for the construction patterns (chained with_* builder vs. direct field assignment for Option<T> pass-through) and the note on snake_case vs. camelCase field naming. This config is not itself serializable — call ResumeSessionConfig::into_wire (crate-private) to produce the wire payload.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§session_id: SessionId

ID of the session to resume.

§model: Option<String>

Model to use for this session (e.g. "gpt-4", "claude-sonnet-4"). Can change the model when resuming.

§allowed_models: Option<Vec<String>>

Exact model IDs the resumed session may use. When unset, the host imposes no model restriction. The runtime validates configured IDs, rejects an explicit empty list, and intersects the list with applicable model policies.

§client_name: Option<String>

Application name sent as User-Agent context.

§reasoning_effort: Option<String>

Desired reasoning effort to apply after resuming the session.

§reasoning_summary: Option<ReasoningSummary>

Reasoning summary mode to apply after resuming the session. Use ReasoningSummary::None to suppress summary output regardless of whether reasoning is enabled.

§context_tier: Option<String>

Context window tier to apply after resuming the session. Use "long_context" to pin the session to the long-context tier.

§streaming: Option<bool>

Enable streaming token deltas.

§system_message: Option<SystemMessageConfig>

Re-supply the system message so the agent retains workspace context across CLI process restarts.

§ask_user_variant: Option<AskUserVariant>

Selects the model-facing shape of the built-in ask_user tool on a cold resume.

When omitted, the runtime uses AskUserVariant::Legacy. To use AskUserVariant::Elicitation, also install an ElicitationHandler.

§tools: Option<Vec<Tool>>

Client-defined tool declarations to re-supply on resume.

§canvases: Option<Vec<CanvasDeclaration>>

Canvas declarations this connection provides to the runtime.

§canvas_handler: Option<Arc<dyn CanvasHandler>>

Provider-side canvas lifecycle handler. See SessionConfig::canvas_handler.

§open_canvases: Option<Vec<OpenCanvasInstance>>

Open canvas instances the caller knows were open before this resume.

§request_canvas_renderer: Option<bool>

Request canvas renderer tools for this connection.

§request_extensions: Option<bool>

Request extension tools and dispatch for this connection.

§extension_sdk_path: Option<String>

Optional override path to a copilot-sdk/ folder to inject into extension subprocesses for this session on resume. See SessionConfig::extension_sdk_path.

§extension_info: Option<ExtensionInfo>

Stable extension identity for canvas/tool providers on this connection.

§canvas_provider: Option<CanvasProviderIdentity>

Stable identity for a host/SDK connection that supplies built-in canvases, so they rehydrate against a stable extension id on resume.

§available_tools: Option<Vec<String>>

Allowlist of tool names the agent may use.

§excluded_tools: Option<Vec<String>>

Blocklist of built-in tool names.

§excluded_builtin_agents: Option<Vec<String>>

Names of built-in agents to exclude from the resumed session.

Excluded built-in agents are hidden from discovery and cannot be selected or invoked unless a custom agent with the same name is configured.

§included_builtin_skills: Option<Vec<String>>

Built-in skill names to include in the resumed session. In ClientMode::Empty, None excludes all runtime-bundled skills; Some opts the named built-ins back in.

§mcp_servers: Option<IndexMap<String, McpServerConfig>>

Re-supply MCP servers so they remain available after app restart.

§mcp_oauth_token_storage: Option<String>

Controls how MCP OAuth tokens are stored for this session. See SessionConfig::mcp_oauth_token_storage for details.

§auth_client_id_metadata_url: Option<String>

Re-supply the host OAuth client metadata document URL on resume.

Set this to the same host identity used when the session was created. When unset, the SDK does not supply a first-party host identity. See SessionConfig::auth_client_id_metadata_url for details.

§enable_config_discovery: Option<bool>

Enables runtime discovery of supported configuration. Explicitly supplied configuration takes precedence over discovered values.

§skip_embedding_retrieval: Option<bool>

When true, skips embedding retrieval on resume.

§embedding_cache_storage: Option<String>

Controls how the embedding cache is stored for this session.

§organization_custom_instructions: Option<String>

Organization-level custom instructions to apply on resume.

§enable_on_demand_instruction_discovery: Option<bool>

When true, enables on-demand instruction discovery on resume.

§enable_file_hooks: Option<bool>

When true, enables file hooks on resume.

§enable_host_git_operations: Option<bool>

When true, allows host Git operations on resume.

§enable_session_store: Option<bool>

When true, enables the session store on resume.

§enable_skills: Option<bool>

When true, enables skills on resume.

§enable_mcp_apps: Option<bool>

Experimental. This option is part of an experimental wire-protocol surface (SEP-1865) and may change or be removed in a future release.

Enable MCP Apps (SEP-1865) UI passthrough on resume. See SessionConfig::enable_mcp_apps. Defaults to None (treated as false).

§github_mcp_tool_config: Option<GitHubMcpToolConfig>

Configuration for the built-in GitHub MCP server.

disable_form_deferral only applies to that server and only has an effect when MCP Apps and form-backed GitHub tools are enabled.

§skill_directories: Option<Vec<PathBuf>>

Skill directory paths passed through to the GitHub Copilot CLI on resume.

§instruction_directories: Option<Vec<PathBuf>>

Additional directories to search for custom instruction files on resume. Forwarded to the CLI; not the same as skill_directories.

§plugin_directories: Option<Vec<PathBuf>>

Open Plugin directory paths passed through to the CLI on resume.

§large_output: Option<LargeToolOutputConfig>

Configuration for large tool output handling, forwarded to the CLI on resume.

§tool_search: Option<ToolSearchConfig>

Overrides the runtime’s built-in tool-search behavior on resume. When unset, the runtime default applies.

§disabled_skills: Option<Vec<String>>

Skill names to disable on resume.

§disabled_mcp_servers: Option<Vec<String>>

Exact MCP server names to disable on resume. This prevents startup and authentication during a cold resume, but cannot stop resident servers.

§hooks: Option<bool>

Enable session hooks on resume.

§custom_agents: Option<Vec<CustomAgentConfig>>

Custom agents to re-supply on resume.

§default_agent: Option<DefaultAgentConfig>

Configures the built-in default agent on resume.

§agent: Option<String>

Name of the custom agent to activate.

§infinite_sessions: Option<InfiniteSessionConfig>

Re-supply infinite session configuration on resume.

§provider: Option<ProviderConfig>

Re-supply BYOK provider configuration on resume.

§capi: Option<CapiSessionOptions>

Re-supply provider-scoped CAPI session options on resume.

Use this to opt out of the default WebSocket transport for CAPI Responses API calls, equivalent to setting COPILOT_CLI_DISABLE_WEBSOCKET_RESPONSES.

§providers: Option<Vec<NamedProviderConfig>>

Experimental. This field is part of an experimental multi-provider BYOK surface and may change or be removed in a future release.

Re-supply named BYOK provider connections on resume. Additive to the default Copilot routing. Referenced by models.

§models: Option<Vec<ProviderModelConfig>>

Experimental. This field is part of an experimental multi-provider BYOK surface and may change or be removed in a future release.

Re-supply BYOK model definitions on resume, each referencing a providers entry by name.

§enable_session_telemetry: Option<bool>

Enables or disables internal session telemetry for this session.

When Some(false), disables session telemetry. When None or Some(true), telemetry is enabled for GitHub-authenticated sessions. When a custom provider is configured, session telemetry is always disabled regardless of this setting. This is independent of ClientOptions::telemetry.

§enable_citations: Option<bool>

Experimental. Enables native model citations for supported providers.

§enable_file_change_tracking: Option<bool>

Opts in to capturing file changes for session rewind and cumulative session diff when the resumed session has a valid baseline. Earlier untracked changes cannot be reconstructed.

§session_limits: Option<SessionLimitsConfig>

Experimental. Limits applied to this session’s current accounting window.

§model_capabilities: Option<ModelCapabilitiesOverride>

Per-property model capability overrides on resume.

§memory: Option<MemoryConfiguration>

Per-session configuration for the runtime memory feature on resume.

§config_directory: Option<PathBuf>

Override the default configuration directory location on resume.

§working_directory: Option<PathBuf>

Per-session working directory on resume.

§additional_directories: Option<Vec<PathBuf>>

Additional directories the agent may access on resume. Relative paths resolve against the session working directory.

§github_token: Option<String>

Per-session GitHub token on resume. See SessionConfig::github_token.

§github_token_provider: Option<Arc<dyn GitHubTokenProvider>>

Rotating GitHub token provider on resume. See SessionConfig::github_token_provider.

§remote_session: Option<RemoteSessionMode>

Per-session remote behavior control on resume. See SessionConfig::remote_session.

§include_sub_agent_streaming_events: Option<bool>

Forward sub-agent streaming events to this connection on resume.

§commands: Option<Vec<CommandDefinition>>

Slash commands registered for this session on resume. See SessionConfig::commands — commands are not persisted server-side, so the resume payload re-supplies the registration.

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

Feature-flag values resolved by the host to apply on resume.

See SessionConfig::feature_flags.

§enable_managed_settings: Option<bool>

Opt-in flag injected on resume. See SessionConfig::enable_managed_settings. Re-supply on resume so the runtime re-applies the managed-settings self-fetch after a CLI process restart. Set via with_enable_managed_settings.

§managed_settings: Option<ManagedSettings>

Optional managed-settings layer injected on resume. See SessionConfig::managed_settings. This layer is not persisted, so it must be re-supplied on resume to remain in effect; omitting it clears the previously injected layer. Serialized on the wire as managedSettings. Set via with_managed_settings.

§session_fs_provider: Option<Arc<dyn SessionFsProvider>>

Custom session filesystem provider. Required on resume when the Client was started with ClientOptions::session_fs. See SessionConfig::session_fs_provider.

§suppress_resume_event: Option<bool>

Force-fail resume if the session does not exist on disk, instead of silently starting a new session. Wire field name stays disableResume.

§continue_pending_work: Option<bool>

When true, instructs the runtime to continue any tool calls or permission requests that were pending when the previous connection was dropped. Use this together with Client::force_stop to hand off a session from one process to another without losing in-flight work.

§permission_handler: Option<Arc<dyn PermissionHandler>>

Optional permission-request handler. See SessionConfig::permission_handler.

§elicitation_handler: Option<Arc<dyn ElicitationHandler>>

Optional elicitation handler. See SessionConfig::elicitation_handler.

§mcp_auth_handler: Option<Arc<dyn McpAuthHandler>>

Optional MCP OAuth handler. See SessionConfig::mcp_auth_handler.

§user_input_handler: Option<Arc<dyn UserInputHandler>>

Optional user-input handler. See SessionConfig::user_input_handler.

§exit_plan_mode_handler: Option<Arc<dyn ExitPlanModeHandler>>

Optional exit-plan-mode handler. See SessionConfig::exit_plan_mode_handler.

§auto_mode_switch_handler: Option<Arc<dyn AutoModeSwitchHandler>>

Optional auto-mode-switch handler. See SessionConfig::auto_mode_switch_handler.

§hooks_handler: Option<Arc<dyn SessionHooks>>

Session hook handler. See SessionConfig::hooks_handler.

§system_message_transform: Option<Arc<dyn SystemMessageTransform>>

System-message transform. See SessionConfig::system_message_transform.

§skip_custom_instructions: Option<bool>§custom_agents_local_only: Option<bool>§enable_experimental_mode: Option<bool>

Controls whether the session enables experimental features.

Defaults to false in crate::ClientMode::Empty when unset; in copilot-cli mode, leaving this unset lets the runtime decide.

§coauthor_enabled: Option<bool>§manage_schedule_enabled: Option<bool>§event_buffer_capacity: Option<usize>

Implementations§

Source§

impl ResumeSessionConfig

Source

pub fn new(session_id: SessionId) -> Self

Construct a ResumeSessionConfig with the given session ID and all other fields left unset. Combine with .with_* builders or struct update syntax (..ResumeSessionConfig::new(id)) to populate the fields you need.

Source

pub fn with_permission_handler( self, handler: Arc<dyn PermissionHandler>, ) -> Self

Install a PermissionHandler for the resumed session.

Source

pub fn with_elicitation_handler( self, handler: Arc<dyn ElicitationHandler>, ) -> Self

Install an ElicitationHandler for the resumed session.

Source

pub fn with_mcp_auth_handler(self, handler: Arc<dyn McpAuthHandler>) -> Self

Install an McpAuthHandler for host-provided MCP OAuth tokens.

Source

pub fn with_user_input_handler(self, handler: Arc<dyn UserInputHandler>) -> Self

Install a UserInputHandler for the resumed session.

Source

pub fn with_ask_user_variant(self, variant: AskUserVariant) -> Self

Select the model-facing shape of the built-in ask_user tool on resume.

Source

pub fn with_exit_plan_mode_handler( self, handler: Arc<dyn ExitPlanModeHandler>, ) -> Self

Install an ExitPlanModeHandler for the resumed session.

Source

pub fn with_auto_mode_switch_handler( self, handler: Arc<dyn AutoModeSwitchHandler>, ) -> Self

Install an AutoModeSwitchHandler for the resumed session.

Source

pub fn with_hooks(self, hooks: Arc<dyn SessionHooks>) -> Self

Install a SessionHooks handler. Automatically enables the wire-level hooks flag on session resumption.

Source

pub fn with_system_message_transform( self, transform: Arc<dyn SystemMessageTransform>, ) -> Self

Source

pub fn with_commands(self, commands: Vec<CommandDefinition>) -> Self

Register slash commands for the resumed session. See SessionConfig::with_commands — commands are not persisted server-side, so the resume payload re-supplies the registration.

Source

pub fn with_session_fs_provider( self, provider: Arc<dyn SessionFsProvider>, ) -> Self

Install a SessionFsProvider backing the resumed session’s filesystem. See SessionConfig::with_session_fs_provider.

Source

pub fn approve_all_permissions(self) -> Self

Auto-approve every permission request on the resumed session. See SessionConfig::approve_all_permissions.

Source

pub fn deny_all_permissions(self) -> Self

Auto-deny every permission request on the resumed session. See SessionConfig::deny_all_permissions.

Source

pub fn approve_permissions_if<F>(self, predicate: F) -> Self
where F: Fn(&PermissionRequestData) -> bool + Send + Sync + 'static,

Apply a closure-based permission policy on the resumed session. See SessionConfig::approve_permissions_if.

Source

pub fn with_model(self, model: impl Into<String>) -> Self

Set the model identifier to switch to on resume (e.g. "claude-sonnet-4").

Source

pub fn with_allowed_models<I, S>(self, models: I) -> Self
where I: IntoIterator<Item = S>, S: Into<String>,

Restrict the resumed session to the provided exact model IDs.

Passing an empty iterator sends an explicit empty list, which the runtime rejects.

Source

pub fn with_client_name(self, name: impl Into<String>) -> Self

Set the application name sent as User-Agent context.

Source

pub fn with_reasoning_effort(self, effort: impl Into<String>) -> Self

Set the reasoning effort to apply on resume.

Source

pub fn with_reasoning_summary(self, summary: ReasoningSummary) -> Self

Source

pub fn with_context_tier(self, tier: impl Into<String>) -> Self

Set the context window tier to apply on resume (e.g. "default", "long_context").

Source

pub fn with_streaming(self, streaming: bool) -> Self

Enable streaming token deltas via assistant.message_delta events.

Source

pub fn with_system_message(self, system_message: SystemMessageConfig) -> Self

Re-supply the system message so the agent retains workspace context across CLI process restarts.

Source

pub fn with_tools<I: IntoIterator<Item = Tool>>(self, tools: I) -> Self

Re-supply client-defined tools on resume.

Source

pub fn with_canvases<I: IntoIterator<Item = CanvasDeclaration>>( self, canvases: I, ) -> Self

Re-supply canvas declarations on resume.

Source

pub fn with_canvas_handler(self, handler: Arc<dyn CanvasHandler>) -> Self

Install the provider-side CanvasHandler for the resumed session.

Source

pub fn with_open_canvases<I: IntoIterator<Item = OpenCanvasInstance>>( self, open_canvases: I, ) -> Self

Seed open canvas instances that were visible before resuming.

Source

pub fn with_request_canvas_renderer(self, request: bool) -> Self

Request host canvas renderer tools for this connection on resume.

Source

pub fn with_request_extensions(self, request: bool) -> Self

Request extension tools and dispatch for this connection on resume.

Source

pub fn with_extension_sdk_path(self, path: impl Into<String>) -> Self

Override the bundled @github/copilot-sdk drop injected into extension subprocesses for this resumed session. Invalid paths fall back to the bundled SDK silently.

Source

pub fn with_extension_info(self, extension_info: ExtensionInfo) -> Self

Set stable extension identity metadata for this connection on resume.

Source

pub fn with_canvas_provider( self, canvas_provider: CanvasProviderIdentity, ) -> Self

Set the canvas provider identity for this connection on resume so host-supplied canvases rehydrate against a stable extension id.

Source

pub fn with_available_tools<I, S>(self, tools: I) -> Self
where I: IntoIterator<Item = S>, S: Into<String>,

Set the allowlist of tool names the agent may use.

Source

pub fn with_excluded_tools<I, S>(self, tools: I) -> Self
where I: IntoIterator<Item = S>, S: Into<String>,

Set the blocklist of built-in tool names the agent must not use.

Source

pub fn with_excluded_builtin_agents<I, S>(self, agents: I) -> Self
where I: IntoIterator<Item = S>, S: Into<String>,

Set the built-in agent names to exclude from the resumed session.

Source

pub fn with_mcp_servers( self, servers: IndexMap<String, McpServerConfig>, ) -> Self

Re-supply MCP server configurations on resume.

Source

pub fn with_mcp_oauth_token_storage(self, mode: impl Into<String>) -> Self

Set MCP OAuth token storage mode on resume. See SessionConfig::with_mcp_oauth_token_storage for details.

Source

pub fn with_auth_client_id_metadata_url(self, url: impl Into<String>) -> Self

Set the host OAuth client metadata document URL on resume.

Source

pub fn with_embedding_cache_storage( self, embedding_cache_storage: impl Into<String>, ) -> Self

Set embedding cache storage mode on resume.

Source

pub fn with_enable_config_discovery(self, enable: bool) -> Self

Enables runtime discovery of supported configuration. Explicitly supplied configuration takes precedence over discovered values.

Source

pub fn with_skip_embedding_retrieval(self, value: bool) -> Self

Source

pub fn with_organization_custom_instructions( self, instructions: impl Into<String>, ) -> Self

Source

pub fn with_enable_on_demand_instruction_discovery(self, value: bool) -> Self

Source

pub fn with_enable_file_hooks(self, value: bool) -> Self

Source

pub fn with_enable_host_git_operations(self, value: bool) -> Self

Source

pub fn with_enable_session_store(self, value: bool) -> Self

Source

pub fn with_enable_skills(self, value: bool) -> Self

Source

pub fn with_enable_mcp_apps(self, enable: bool) -> Self

Experimental. This method is part of an experimental wire-protocol surface (SEP-1865) and may change or be removed in a future release.

Enable MCP Apps (SEP-1865) UI passthrough on resume. Defaults to None (treated as false). See SessionConfig::enable_mcp_apps.

Source

pub fn with_github_mcp_tool_config(self, config: GitHubMcpToolConfig) -> Self

Set the built-in GitHub MCP server configuration.

Source

pub fn with_skill_directories<I, P>(self, paths: I) -> Self
where I: IntoIterator<Item = P>, P: Into<PathBuf>,

Set skill directory paths passed through to the CLI on resume.

Source

pub fn with_included_builtin_skills<I, S>(self, names: I) -> Self
where I: IntoIterator<Item = S>, S: Into<String>,

Set the runtime-bundled skill allowlist on resume.

Source

pub fn with_instruction_directories<I, P>(self, paths: I) -> Self
where I: IntoIterator<Item = P>, P: Into<PathBuf>,

Set additional directories to search for custom instruction files on resume. Forwarded to the CLI; not the same as with_skill_directories.

Source

pub fn with_plugin_directories<I, P>(self, paths: I) -> Self
where I: IntoIterator<Item = P>, P: Into<PathBuf>,

Set Open Plugin directory paths passed through to the CLI on resume.

Source

pub fn with_large_output(self, config: LargeToolOutputConfig) -> Self

Set the LargeToolOutputConfig forwarded to the CLI on resume.

Set the ToolSearchConfig overriding the runtime’s built-in tool-search behavior on resume.

Source

pub fn with_disabled_skills<I, S>(self, names: I) -> Self
where I: IntoIterator<Item = S>, S: Into<String>,

Set the names of skills to disable on resume.

Source

pub fn with_disabled_mcp_servers<I, S>(self, names: I) -> Self
where I: IntoIterator<Item = S>, S: Into<String>,

Set exact MCP server names to disable for this session.

Source

pub fn with_custom_agents<I: IntoIterator<Item = CustomAgentConfig>>( self, agents: I, ) -> Self

Re-supply custom agents on resume.

Source

pub fn with_default_agent(self, agent: DefaultAgentConfig) -> Self

Configure the built-in default agent on resume.

Source

pub fn with_agent(self, name: impl Into<String>) -> Self

Activate a named custom agent on resume.

Source

pub fn with_infinite_sessions(self, config: InfiniteSessionConfig) -> Self

Re-supply infinite session configuration on resume.

Source

pub fn with_provider(self, provider: ProviderConfig) -> Self

Re-supply BYOK provider configuration on resume.

Source

pub fn with_capi(self, capi: CapiSessionOptions) -> Self

Re-supply provider-scoped CAPI session options on resume.

Source

pub fn with_providers(self, providers: Vec<NamedProviderConfig>) -> Self

Experimental. This method is part of an experimental multi-provider BYOK surface and may change or be removed in a future release.

Re-supply the named BYOK provider connections on resume. Attach models referencing these with Self::with_models.

Source

pub fn with_models(self, models: Vec<ProviderModelConfig>) -> Self

Experimental. This method is part of an experimental multi-provider BYOK surface and may change or be removed in a future release.

Re-supply the BYOK model definitions on resume, each referencing a named provider supplied via Self::with_providers.

Source

pub fn with_enable_session_telemetry(self, enable: bool) -> Self

Enable or disable internal session telemetry on resume.

See Self::enable_session_telemetry for default and BYOK behavior.

Source

pub fn with_enable_citations(self, enable: bool) -> Self

Experimental. Enable native model citations for supported providers on resume.

Source

pub fn with_enable_file_change_tracking(self, enable: bool) -> Self

Opt in to capturing file changes for session rewind and cumulative session diff when the resumed session has a valid baseline.

Source

pub fn with_session_limits(self, limits: SessionLimitsConfig) -> Self

Experimental. Set limits for this session’s current accounting window.

Source

pub fn with_model_capabilities( self, capabilities: ModelCapabilitiesOverride, ) -> Self

Set per-property model capability overrides on resume.

Source

pub fn with_memory(self, memory: MemoryConfiguration) -> Self

Configure the runtime memory feature for the resumed session.

Source

pub fn with_config_directory(self, dir: impl Into<PathBuf>) -> Self

Override the default configuration directory location on resume.

Source

pub fn with_working_directory(self, dir: impl Into<PathBuf>) -> Self

Set the per-session working directory on resume.

Source

pub fn with_additional_directories<I, P>(self, paths: I) -> Self
where I: IntoIterator<Item = P>, P: Into<PathBuf>,

Set directories the agent may access beyond the working directory on resume.

Source

pub fn with_github_token(self, token: impl Into<String>) -> Self

Set the per-session GitHub token on resume. See SessionConfig::github_token for distinction from the client-level token.

Source

pub fn with_github_token_provider( self, provider: Arc<dyn GitHubTokenProvider>, ) -> Self

Install a rotating GitHub token provider for the resumed session.

The provider must return a positive remaining lifetime in seconds when its callback completes. Production GitHub tokens typically last eight hours. Mutually exclusive with with_github_token.

Source

pub fn with_include_sub_agent_streaming_events(self, include: bool) -> Self

Forward sub-agent streaming events to this connection on resume.

Source

pub fn with_remote_session(self, mode: RemoteSessionMode) -> Self

Set per-session remote behavior on resume.

Source

pub fn with_suppress_resume_event(self, suppress: bool) -> Self

Force-fail resume if the session does not exist on disk, instead of silently starting a new session.

Source

pub fn with_continue_pending_work(self, continue_pending: bool) -> Self

When true, instructs the runtime to continue any tool calls or permission requests that were pending when the previous connection was dropped. Use this together with Client::force_stop to hand off a session from one process to another without losing in-flight work.

Source

pub fn with_skip_custom_instructions(self, value: bool) -> Self

Source

pub fn with_custom_agents_local_only(self, value: bool) -> Self

Source

pub fn with_enable_experimental_mode( self, enable_experimental_mode: bool, ) -> Self

Source

pub fn with_coauthor_enabled(self, value: bool) -> Self

Source

pub fn with_manage_schedule_enabled(self, value: bool) -> Self

Source

pub fn with_feature_flags(self, feature_flags: HashMap<String, bool>) -> Self

Re-supply feature-flag values resolved by the host on resume.

Source

pub fn with_event_buffer_capacity(self, capacity: usize) -> Self

Set Self::event_buffer_capacity.

A capacity of 0 is rejected with ErrorKind::InvalidConfig by Client::prepare_resume_session and Client::resume_session; the value is never clamped.

Source

pub fn with_enable_managed_settings(self, enabled: bool) -> Self

Opt the runtime into self-fetching enterprise managed settings on resume. See SessionConfig::with_enable_managed_settings.

Source

pub fn with_managed_settings(self, managed_settings: ManagedSettings) -> Self

Inject a managed-settings layer (currently permission rules) on resume. See SessionConfig::with_managed_settings. Must be re-supplied on resume; omitting it clears the previously injected layer.

Trait Implementations§

Source§

impl Clone for ResumeSessionConfig

Source§

fn clone(&self) -> Self

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 ResumeSessionConfig

Source§

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

Formats the value using the given formatter. 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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 = !

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

fn try_from(value: U) -> Result<T, !>

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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