From 4ae96c6e02931e711f472abe8d32196db71833c8 Mon Sep 17 00:00:00 2001 From: Sakura-RanChen <1908198662@qq.com> Date: Thu, 19 Nov 2026 09:40:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=85=8D=E7=BD=AE=E8=AF=BB=E5=8F=96?= =?UTF-8?q?=E7=BC=BA=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/xiaozhi-server/core/connection.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main/xiaozhi-server/core/connection.py b/main/xiaozhi-server/core/connection.py index 0ccc99e7b..ec5c442c9 100644 --- a/main/xiaozhi-server/core/connection.py +++ b/main/xiaozhi-server/core/connection.py @@ -916,6 +916,8 @@ class ConnectionHandler: self.chat_history_conf = int(private_config["chat_history_conf"]) if private_config.get("mcp_endpoint", None) is not None: self.config["mcp_endpoint"] = private_config["mcp_endpoint"] + if private_config.get("mcp_forward_speaker", None) is not None: + self.config["mcp_forward_speaker"] = private_config["mcp_forward_speaker"] if private_config.get("context_providers", None) is not None: self.config["context_providers"] = private_config["context_providers"] @@ -1132,7 +1134,7 @@ class ConnectionHandler: try: parsed = json.loads(q) if isinstance(parsed, dict): - cs = (parsed.get("speaker") or "").strip() + cs = str(parsed.get("speaker") or "").strip() except (json.JSONDecodeError, TypeError, ValueError): pass if cs and cs != UNKNOWN_SPEAKER_NAME and cs not in self.system_introduced_speakers: