@@ -297,7 +297,7 @@ impl ChatArgs {
297297 info ! ( ?conversation_id, "Generated new conversation id" ) ;
298298
299299 // Check MCP status once at the beginning of the session
300- let mcp_enabled = match os. client . is_mcp_enabled ( ) . await {
300+ let mcp_enabled = match os. client . as_ref ( ) . unwrap ( ) . is_mcp_enabled ( ) . await {
301301 Ok ( enabled) => enabled,
302302 Err ( err) => {
303303 tracing:: warn!( ?err, "Failed to check MCP configuration, defaulting to enabled" ) ;
@@ -1222,7 +1222,7 @@ impl ChatSession {
12221222 request_metadata_lock : Arc < Mutex < Option < RequestMetadata > > > ,
12231223 message_meta_tags : Option < Vec < MessageMetaTag > > ,
12241224 ) -> Result < SendMessageStream , ChatError > {
1225- match SendMessageStream :: send_message ( & os. client , conversation_state, request_metadata_lock, message_meta_tags)
1225+ match SendMessageStream :: send_message ( os. client . as_ref ( ) . unwrap ( ) , conversation_state, request_metadata_lock, message_meta_tags)
12261226 . await
12271227 {
12281228 Ok ( res) => Ok ( res) ,
@@ -3329,7 +3329,7 @@ impl ChatSession {
33293329 }
33303330
33313331 async fn retry_model_overload ( & mut self , os : & mut Os ) -> Result < ChatState , ChatError > {
3332- os. client . invalidate_model_cache ( ) . await ;
3332+ os. client . as_ref ( ) . unwrap ( ) . invalidate_model_cache ( ) . await ;
33333333 match select_model ( os, self ) . await {
33343334 Ok ( Some ( _) ) => ( ) ,
33353335 Ok ( None ) => {
@@ -3752,7 +3752,7 @@ async fn get_subscription_status(os: &mut Os) -> Result<ActualSubscriptionStatus
37523752 return Ok ( ActualSubscriptionStatus :: Active ) ;
37533753 }
37543754
3755- match os. client . create_subscription_token ( ) . await {
3755+ match os. client . as_ref ( ) . unwrap ( ) . create_subscription_token ( ) . await {
37563756 Ok ( response) => match response. status ( ) {
37573757 SubscriptionStatus :: Active => Ok ( ActualSubscriptionStatus :: Expiring ) ,
37583758 SubscriptionStatus :: Inactive => Ok ( ActualSubscriptionStatus :: None ) ,
@@ -3892,7 +3892,7 @@ mod tests {
38923892 #[ tokio:: test]
38933893 async fn test_flow ( ) {
38943894 let mut os = Os :: new ( ) . await . unwrap ( ) ;
3895- os. client . set_mock_output ( serde_json:: json!( [
3895+ os. client . as_mut ( ) . unwrap ( ) . set_mock_output ( serde_json:: json!( [
38963896 [
38973897 "Sure, I'll create a file for you" ,
38983898 {
@@ -3945,7 +3945,7 @@ mod tests {
39453945 #[ tokio:: test]
39463946 async fn test_flow_tool_permissions ( ) {
39473947 let mut os = Os :: new ( ) . await . unwrap ( ) ;
3948- os. client . set_mock_output ( serde_json:: json!( [
3948+ os. client . as_mut ( ) . unwrap ( ) . set_mock_output ( serde_json:: json!( [
39493949 [
39503950 "Ok" ,
39513951 {
@@ -4092,7 +4092,7 @@ mod tests {
40924092 async fn test_flow_multiple_tools ( ) {
40934093 // let _ = tracing_subscriber::fmt::try_init();
40944094 let mut os = Os :: new ( ) . await . unwrap ( ) ;
4095- os. client . set_mock_output ( serde_json:: json!( [
4095+ os. client . as_mut ( ) . unwrap ( ) . set_mock_output ( serde_json:: json!( [
40964096 [
40974097 "Sure, I'll create a file for you" ,
40984098 {
@@ -4186,7 +4186,7 @@ mod tests {
41864186 async fn test_flow_tools_trust_all ( ) {
41874187 // let _ = tracing_subscriber::fmt::try_init();
41884188 let mut os = Os :: new ( ) . await . unwrap ( ) ;
4189- os. client . set_mock_output ( serde_json:: json!( [
4189+ os. client . as_mut ( ) . unwrap ( ) . set_mock_output ( serde_json:: json!( [
41904190 [
41914191 "Sure, I'll create a file for you" ,
41924192 {
@@ -4273,7 +4273,7 @@ mod tests {
42734273 #[ cfg( unix) ]
42744274 async fn test_subscribe_flow ( ) {
42754275 let mut os = Os :: new ( ) . await . unwrap ( ) ;
4276- os. client . set_mock_output ( serde_json:: Value :: Array ( vec ! [ ] ) ) ;
4276+ os. client . as_mut ( ) . unwrap ( ) . set_mock_output ( serde_json:: Value :: Array ( vec ! [ ] ) ) ;
42774277 let agents = get_test_agents ( & os) . await ;
42784278
42794279 let tool_manager = ToolManager :: default ( ) ;
@@ -4315,7 +4315,7 @@ mod tests {
43154315 } ;
43164316
43174317 let mut os = Os :: new ( ) . await . unwrap ( ) ;
4318- os. client . set_mock_output ( serde_json:: json!( [
4318+ os. client . as_mut ( ) . unwrap ( ) . set_mock_output ( serde_json:: json!( [
43194319 [
43204320 "I'll read that file for you" ,
43214321 {
@@ -4463,7 +4463,7 @@ mod tests {
44634463 os. fs . write ( "/sensitive.txt" , "classified information" ) . await . unwrap ( ) ;
44644464
44654465 // Mock LLM responses: first tries fs_read, gets blocked, then responds to error
4466- os. client . set_mock_output ( serde_json:: json!( [
4466+ os. client . as_mut ( ) . unwrap ( ) . set_mock_output ( serde_json:: json!( [
44674467 [
44684468 "I'll read that file for you" ,
44694469 {
0 commit comments