mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-05 00:23:10 +00:00
ACP: update package, fix slash command bug (#3906)
This commit is contained in:
@@ -77,7 +77,15 @@ export namespace MCP {
|
||||
}
|
||||
},
|
||||
async (state) => {
|
||||
await Promise.all(Object.values(state.clients).map((client) => client.close()))
|
||||
await Promise.all(
|
||||
Object.values(state.clients).map((client) =>
|
||||
client.close().catch((error) => {
|
||||
log.error("Failed to close MCP client", {
|
||||
error,
|
||||
})
|
||||
}),
|
||||
),
|
||||
)
|
||||
},
|
||||
)
|
||||
|
||||
@@ -201,7 +209,15 @@ export namespace MCP {
|
||||
|
||||
const result = await withTimeout(mcpClient.tools(), mcp.timeout ?? 5000).catch(() => {})
|
||||
if (!result) {
|
||||
await mcpClient.close()
|
||||
await mcpClient.close().catch((error) => {
|
||||
log.error("Failed to close MCP client", {
|
||||
error,
|
||||
})
|
||||
})
|
||||
status = {
|
||||
status: "failed",
|
||||
error: "Failed to get tools",
|
||||
}
|
||||
return {
|
||||
mcpClient: undefined,
|
||||
status: {
|
||||
|
||||
Reference in New Issue
Block a user