#[non_exhaustive]pub struct ResumeSessionRequest {
pub session_id: SessionId,
pub cwd: AbsolutePath,
pub additional_directories: Vec<AbsolutePath>,
pub mcp_servers: Vec<McpServer>,
pub replay_from: Option<ReplayFrom>,
pub system_prompt: Option<SystemPrompt>,
pub config_options: Vec<InitialSessionConfigOption>,
pub meta: Option<Meta>,
}unstable_protocol_v2 only.Expand description
Request parameters for resuming an existing session.
Resumes an existing session and optionally replays retained conversation
history according to replayFrom.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.session_id: SessionIdThe ID of the session to resume.
cwd: AbsolutePathThe working directory for this session. Must be an absolute path.
Clients MUST send the session’s working directory. Agents MAY reject a different directory
with -32602, and MAY normalize paths when comparing.
additional_directories: Vec<AbsolutePath>Additional workspace roots to activate for this session. Each path MUST be absolute.
When omitted or empty, no additional roots are activated. When non-empty,
this is the complete resulting additional-root list for the resumed
session. It MAY differ from any previously used or reported list as long as
the request cwd matches the session’s cwd.
mcp_servers: Vec<McpServer>List of MCP servers to connect to for this session.
The complete set of Client-provided servers. Omitted and [] mean none. Agents SHOULD
NOT restore servers from earlier requests.
replay_from: Option<ReplayFrom>Inclusive cursor describing where conversation replay begins.
Optional. Omitted and null are equivalent, and the Agent MUST NOT replay
previous conversation history. Replay cursors are inclusive:
replay includes the position identified by the cursor. Supplying
{ "type": "start" } means the Agent MUST replay all retained
conversation history before responding.
Agents MUST reject unsupported cursor types or malformed cursor values
with -32602 (Invalid params), rather than substituting another cursor
or resuming without replay.
system_prompt: Option<SystemPrompt>System-level instructions for the resumed session.
Optional. Omitted and null are equivalent. The Agent MAY then keep a
system prompt it stored with the session or use its default instructions.
Clients MUST only send this when the Agent advertises
session.systemPrompt, and SHOULD send the same value they used when the
session was created.
config_options: Vec<InitialSessionConfigOption>unstable_session_options only.UNSTABLE
This capability is not part of the spec yet, and may be removed or changed at any point.
Initial values for the session’s config options.
Optional. Omitted and null are equivalent to an empty list. Clients MUST only send
this when the Agent advertises session.options.
The Agent applies the entries in list order, as if the Client had called
session/set_config_option for each entry after the session was set up. Malformed
entries and duplicate configId values fail the request with -32602. The Agent MUST
ignore an entry whose configId is unknown, whose type does not match the option,
or whose value is not allowed when it is applied. The configOptions in the response contain the values the session actually
has. The Agent SHOULD NOT send config_option_update notifications for these entries
on the requesting connection. If the session is active on other connections, the
Agent SHOULD send config_option_update on those connections.
The Agent applies the entries before it replays history for replayFrom and before
it responds.
meta: Option<Meta>The _meta property is reserved by ACP to allow Clients and Agents to attach additional
metadata to their interactions. Omitted and null are equivalent and mean no metadata.
Implementations MUST NOT assign meaning to keys they do not recognize.
See protocol docs: Extensibility
Implementations§
Source§impl ResumeSessionRequest
impl ResumeSessionRequest
Sourcepub fn new(
session_id: impl Into<SessionId>,
cwd: impl Into<AbsolutePath>,
) -> Self
pub fn new( session_id: impl Into<SessionId>, cwd: impl Into<AbsolutePath>, ) -> Self
Builds ResumeSessionRequest with the required request fields set. Optional fields start unset or empty.
Sourcepub fn additional_directories<I, P>(self, additional_directories: I) -> Self
pub fn additional_directories<I, P>(self, additional_directories: I) -> Self
Additional workspace roots to activate for this session. Each path MUST be absolute.
Sourcepub fn mcp_servers(self, mcp_servers: Vec<McpServer>) -> Self
pub fn mcp_servers(self, mcp_servers: Vec<McpServer>) -> Self
List of MCP servers to connect to for this session.
Sourcepub fn replay_from(self, replay_from: impl IntoOption<ReplayFrom>) -> Self
pub fn replay_from(self, replay_from: impl IntoOption<ReplayFrom>) -> Self
Inclusive cursor describing where conversation replay begins.
Omitted and null are equivalent, and the Agent MUST NOT replay
previous conversation history. Replay cursors are inclusive: replay
includes the position identified by the cursor. Supplying
{ "type": "start" } means the Agent MUST replay all retained
conversation history before responding.
Sourcepub fn system_prompt(self, system_prompt: impl IntoOption<SystemPrompt>) -> Self
pub fn system_prompt(self, system_prompt: impl IntoOption<SystemPrompt>) -> Self
System-level instructions for the resumed session.
Sourcepub fn config_options(
self,
config_options: Vec<InitialSessionConfigOption>,
) -> Self
Available on crate feature unstable_session_options only.
pub fn config_options( self, config_options: Vec<InitialSessionConfigOption>, ) -> Self
unstable_session_options only.UNSTABLE
This capability is not part of the spec yet, and may be removed or changed at any point.
Initial values for the session’s config options.
Optional. Omitted and null are equivalent to an empty list. Clients MUST only send
this when the Agent advertises session.options.
The Agent applies the entries in list order, as if the Client had called
session/set_config_option for each entry after the session was set up. Malformed
entries and duplicate configId values fail the request with -32602. The Agent MUST
ignore an entry whose configId is unknown, whose type does not match the option,
or whose value is not allowed when it is applied. The configOptions in the response contain the values the session actually
has. The Agent SHOULD NOT send config_option_update notifications for these entries
on the requesting connection. If the session is active on other connections, the
Agent SHOULD send config_option_update on those connections.
Sourcepub fn meta(self, meta: impl IntoOption<Meta>) -> Self
pub fn meta(self, meta: impl IntoOption<Meta>) -> Self
The _meta property is reserved by ACP to allow Clients and Agents to attach additional metadata to their interactions. Implementations MUST NOT assign meaning to keys they do not recognize.
See protocol docs: Extensibility
Trait Implementations§
Source§impl Clone for ResumeSessionRequest
impl Clone for ResumeSessionRequest
Source§impl Debug for ResumeSessionRequest
impl Debug for ResumeSessionRequest
Source§impl<'de> Deserialize<'de> for ResumeSessionRequest
impl<'de> Deserialize<'de> for ResumeSessionRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ResumeSessionRequest
Source§impl JsonSchema for ResumeSessionRequest
impl JsonSchema for ResumeSessionRequest
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for ResumeSessionRequest
impl PartialEq for ResumeSessionRequest
Source§impl Serialize for ResumeSessionRequest
impl Serialize for ResumeSessionRequest
impl StructuralPartialEq for ResumeSessionRequest
Auto Trait Implementations§
impl Forget for ResumeSessionRequest
impl Freeze for ResumeSessionRequest
impl Move for ResumeSessionRequest
impl RefUnwindSafe for ResumeSessionRequest
impl Send for ResumeSessionRequest
impl Sync for ResumeSessionRequest
impl Unpin for ResumeSessionRequest
impl UnsafeUnpin for ResumeSessionRequest
impl UnwindSafe for ResumeSessionRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.