File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
src/agent-client-protocol Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -120,11 +120,14 @@ impl acp::Agent for ExampleAgent {
120120 args : acp:: SetSessionConfigOptionRequest ,
121121 ) -> Result < acp:: SetSessionConfigOptionResponse , acp:: Error > {
122122 log:: info!( "Received set session config option request {args:?}" ) ;
123+ #[ cfg( feature = "unstable_boolean_config" ) ]
123124 let value = args
124125 . value
125126 . as_value_id ( )
126127 . ok_or ( acp:: Error :: invalid_params ( ) ) ?
127128 . clone ( ) ;
129+ #[ cfg( not( feature = "unstable_boolean_config" ) ) ]
130+ let value: acp:: SessionConfigValueId = args. value . into ( ) ;
128131 let option = acp:: SessionConfigOption :: select (
129132 args. config_id ,
130133 "Example Option" ,
Original file line number Diff line number Diff line change @@ -156,7 +156,10 @@ impl TestAgent {
156156#[ async_trait:: async_trait( ?Send ) ]
157157impl Agent for TestAgent {
158158 async fn initialize ( & self , arguments : InitializeRequest ) -> Result < InitializeResponse > {
159+ #[ cfg( feature = "unstable_logout" ) ]
159160 let mut capabilities = AgentCapabilities :: new ( ) ;
161+ #[ cfg( not( feature = "unstable_logout" ) ) ]
162+ let capabilities = AgentCapabilities :: new ( ) ;
160163 #[ cfg( feature = "unstable_logout" ) ]
161164 {
162165 capabilities. auth . logout =
@@ -272,11 +275,14 @@ impl Agent for TestAgent {
272275 & self ,
273276 args : agent_client_protocol_schema:: SetSessionConfigOptionRequest ,
274277 ) -> Result < agent_client_protocol_schema:: SetSessionConfigOptionResponse > {
278+ #[ cfg( feature = "unstable_boolean_config" ) ]
275279 let value = args
276280 . value
277281 . as_value_id ( )
278282 . ok_or ( agent_client_protocol_schema:: Error :: invalid_params ( ) ) ?
279283 . clone ( ) ;
284+ #[ cfg( not( feature = "unstable_boolean_config" ) ) ]
285+ let value: agent_client_protocol_schema:: SessionConfigValueId = args. value . into ( ) ;
280286 let option = agent_client_protocol_schema:: SessionConfigOption :: select (
281287 args. config_id ,
282288 "Test Option" ,
You can’t perform that action at this time.
0 commit comments