Skip to main content

SessionStartParams

Struct SessionStartParams 

Source
pub struct SessionStartParams {
    pub command_id: String,
    pub recovery_mode: Option<RecoveryMode>,
    pub session_id: Option<String>,
    pub workspace_root: Option<String>,
    pub workspace_roots: Option<Vec<String>>,
    pub model_id: Option<String>,
    pub provider_id: Option<String>,
    pub approval_mode: Option<ApprovalMode>,
    pub permission_profile: Option<String>,
    pub config: Option<SessionConfig>,
    pub worktree: Option<WorktreeStartRequest>,
}
Expand description

session/start params.

Fields§

§command_id: String

The idempotency handle (UUIDv7). Required; the server never mints one.

§recovery_mode: Option<RecoveryMode>

Recovery choice for this construction; omission keeps legacy behavior. Explicit null is invalid.

§session_id: Option<String>

Exact identity for this new root session. When omitted the server mints a UUIDv7. This field never selects an existing session: a retained or reserved id is rejected commandRejected with reason session_id_conflict.

§workspace_root: Option<String>

Absolute path, folded into the first metadata record.

§workspace_roots: Option<Vec<String>>

The session’s initial runtime workspace-root set: ordered absolute canonical existing directory paths; the first root is the CWD and plays the primary-root role; every root receives the :workspace_roots rules; extra roots grant no Project Trust. When workspaceRoot is also present the two must name the same folder, compared on canonical forms, or the request is invalid params, and so is explicit null. Omitted preserves single-root behavior.

§model_id: Option<String>

Initial model; server default when omitted.

§provider_id: Option<String>

Initial provider routing; server default when omitted or explicit null — both spellings select the default.

§approval_mode: Option<ApprovalMode>

The session’s starting approval mode; server default when omitted or explicit null — both spellings select the default. Select, never create — the value names a mode the host’s configuration already defines. This is the only surface that declares a non-interactive run’s policy.

§permission_profile: Option<String>

The new session’s initial permission profile: a profile id the host catalog already admits — the rows permissionProfile/list serves without sessionId. Select, never create. Omitted means today’s behavior: the host’s configured default under native admission, unchanged. An id the catalog does not carry, or one it serves unavailable, refuses the start commandRejected (-32030; permission_profile_unknown / permission_profile_unavailable) before any durable byte, and an ephemeral host refuses any id (permission_profile_ephemeral_fixed). session/fork does not admit the member; session/resume admits it as the launch pick. Explicit null is invalid params: the set of members that tolerate null is closed and excludes this one, exactly as it excludes workspaceRoots.

§config: Option<SessionConfig>

Reserved for per-session overrides owned by a future Configuration section. Issue a tracked change admits only its mcpServers member.

§worktree: Option<WorktreeStartRequest>

a tracked change: ask for a created worktree or attach an existing one. Experimental (session/start.worktree; unopted callers are refused -32602). Absent means no worktree — the start proceeds exactly as today.

Trait Implementations§

Source§

impl Clone for SessionStartParams

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 SessionStartParams

Source§

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

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

impl<'de> Deserialize<'de> for SessionStartParams

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 Eq for SessionStartParams

Source§

impl PartialEq for SessionStartParams

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for SessionStartParams

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
Source§

impl StructuralPartialEq for SessionStartParams

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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 = !

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.