File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -788,7 +788,8 @@ pub extern "C" fn mcp_list_tools_init() -> usize {
788788 // Clone the Arc to share the service across async boundaries
789789 let service_arc = client. service . clone ( ) ;
790790
791- // Spawn directly on the runtime (Windows compatible)
791+ // Enter the runtime context explicitly before spawning (Windows compatible)
792+ let _guard = client. runtime . enter ( ) ;
792793 client. runtime . spawn ( async move {
793794 let service_guard = service_arc. lock ( ) . await ;
794795 if let Some ( service) = service_guard. as_ref ( ) {
@@ -872,7 +873,8 @@ pub extern "C" fn mcp_call_tool_init(tool_name: *const c_char, arguments: *const
872873 if let Some ( client) = client_opt. as_ref ( ) {
873874 let service_arc = client. service . clone ( ) ;
874875
875- // Spawn directly on the runtime (Windows compatible)
876+ // Enter the runtime context explicitly before spawning (Windows compatible)
877+ let _guard = client. runtime . enter ( ) ;
876878 client. runtime . spawn ( async move {
877879 let service_guard = service_arc. lock ( ) . await ;
878880 if let Some ( service) = service_guard. as_ref ( ) {
You can’t perform that action at this time.
0 commit comments