@@ -10,6 +10,8 @@ use agent_client_protocol_schema::{
1010use agent_client_protocol_schema:: { ForkSessionRequest , ForkSessionResponse } ;
1111#[ cfg( feature = "unstable_session_list" ) ]
1212use agent_client_protocol_schema:: { ListSessionsRequest , ListSessionsResponse } ;
13+ #[ cfg( feature = "unstable_session_resume" ) ]
14+ use agent_client_protocol_schema:: { ResumeSessionRequest , ResumeSessionResponse } ;
1315#[ cfg( feature = "unstable_session_model" ) ]
1416use agent_client_protocol_schema:: { SetSessionModelRequest , SetSessionModelResponse } ;
1517use serde_json:: value:: RawValue ;
@@ -154,6 +156,21 @@ pub trait Agent {
154156 Err ( Error :: method_not_found ( ) )
155157 }
156158
159+ /// **UNSTABLE**
160+ ///
161+ /// This capability is not part of the spec yet, and may be removed or changed at any point.
162+ ///
163+ /// Resumes an existing session without replaying message history.
164+ ///
165+ /// This is similar to `load_session`, except it does not return previous messages.
166+ /// Useful for agents that support continuing conversations but don't store full history.
167+ ///
168+ /// Only available if the Agent supports the `sessionCapabilities.resume` capability.
169+ #[ cfg( feature = "unstable_session_resume" ) ]
170+ async fn resume_session ( & self , _args : ResumeSessionRequest ) -> Result < ResumeSessionResponse > {
171+ Err ( Error :: method_not_found ( ) )
172+ }
173+
157174 /// Handles extension method requests from the client.
158175 ///
159176 /// Extension methods provide a way to add custom functionality while maintaining
@@ -216,6 +233,10 @@ impl<T: Agent> Agent for Rc<T> {
216233 async fn fork_session ( & self , args : ForkSessionRequest ) -> Result < ForkSessionResponse > {
217234 self . as_ref ( ) . fork_session ( args) . await
218235 }
236+ #[ cfg( feature = "unstable_session_resume" ) ]
237+ async fn resume_session ( & self , args : ResumeSessionRequest ) -> Result < ResumeSessionResponse > {
238+ self . as_ref ( ) . resume_session ( args) . await
239+ }
219240 async fn ext_method ( & self , args : ExtRequest ) -> Result < ExtResponse > {
220241 self . as_ref ( ) . ext_method ( args) . await
221242 }
@@ -265,6 +286,10 @@ impl<T: Agent> Agent for Arc<T> {
265286 async fn fork_session ( & self , args : ForkSessionRequest ) -> Result < ForkSessionResponse > {
266287 self . as_ref ( ) . fork_session ( args) . await
267288 }
289+ #[ cfg( feature = "unstable_session_resume" ) ]
290+ async fn resume_session ( & self , args : ResumeSessionRequest ) -> Result < ResumeSessionResponse > {
291+ self . as_ref ( ) . resume_session ( args) . await
292+ }
268293 async fn ext_method ( & self , args : ExtRequest ) -> Result < ExtResponse > {
269294 self . as_ref ( ) . ext_method ( args) . await
270295 }
0 commit comments