Avoid tool call blocking main thread (dropping packets)

This commit is contained in:
Terrence
2025-05-30 00:52:50 +08:00
parent f5c1c30c5e
commit 1858da4973
2 changed files with 13 additions and 1 deletions

View File

@@ -8,6 +8,7 @@
#include <variant>
#include <optional>
#include <stdexcept>
#include <thread>
#include <cJSON.h>
@@ -274,6 +275,7 @@ private:
void DoToolCall(int id, const std::string& tool_name, const cJSON* tool_arguments);
std::vector<McpTool*> tools_;
std::thread tool_call_thread_;
};
#endif // MCP_SERVER_H