diff --git a/service/src/common/router.ts b/service/src/common/router.ts index 5ff9ab9..630e037 100644 --- a/service/src/common/router.ts +++ b/service/src/common/router.ts @@ -30,6 +30,7 @@ export async function routeMessage(command: string, data: any, webview: PostMess webview.postMessage({ command, data: res }); } } catch (error) { + console.error(error); webview.postMessage({ command, data: { code: 500, diff --git a/service/src/mcp/connect.service.ts b/service/src/mcp/connect.service.ts index ec7bf7c..5f7e50a 100644 --- a/service/src/mcp/connect.service.ts +++ b/service/src/mcp/connect.service.ts @@ -249,12 +249,15 @@ export async function connectService( const uuid = await deterministicUUID(JSON.stringify(option)); const reuseConntion = clientMap.has(uuid); - if (!clientMap.has(uuid)) { - const client = await connect(option); - clientMap.set(uuid, client); - } + + // if (!clientMap.has(uuid)) { + // const client = await connect(option); + // clientMap.set(uuid, client); + // } + // const client = clientMap.get(uuid)!; - const client = clientMap.get(uuid)!; + const client = await connect(option); + clientMap.set(uuid, client); const versionInfo = client.getServerVersion();