From d62b27814c4f1559b70441d27d14e426dced2236 Mon Sep 17 00:00:00 2001 From: myifeng Date: Wed, 28 May 2025 14:09:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8D=B0cmp=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=B6=88=E6=81=AF=EF=BC=8C=E5=90=8E=E6=9C=9F=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/xiaozhi-server/core/handle/textHandle.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main/xiaozhi-server/core/handle/textHandle.py b/main/xiaozhi-server/core/handle/textHandle.py index da6ede47..33596b50 100644 --- a/main/xiaozhi-server/core/handle/textHandle.py +++ b/main/xiaozhi-server/core/handle/textHandle.py @@ -72,6 +72,8 @@ async def handleTextMessage(conn, message): asyncio.create_task(handleIotDescriptors(conn, msg_json["descriptors"])) if "states" in msg_json: asyncio.create_task(handleIotStatus(conn, msg_json["states"])) + elif msg_json["type"] == "mcp": + conn.logger.bind(tag=TAG).info(f"收到mcp消息:{message}") elif msg_json["type"] == "server": # 记录日志时过滤敏感信息 conn.logger.bind(tag=TAG).info( @@ -151,5 +153,7 @@ async def handleTextMessage(conn, message): # 重启服务器 elif msg_json["action"] == "restart": await conn.handle_restart(msg_json) + else: + conn.logger.bind(tag=TAG).error(f"收到未知类型消息:{message}") except json.JSONDecodeError: await conn.websocket.send(message)