From 9879878dd0ea0cfe4f24b8225432ff7d7714f2c1 Mon Sep 17 00:00:00 2001 From: zhayujie Date: Thu, 12 Mar 2026 17:08:09 +0800 Subject: [PATCH] fix: concurrency issue in session --- channel/chat_channel.py | 2 +- config.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/channel/chat_channel.py b/channel/chat_channel.py index c2ee238..6cbf840 100644 --- a/channel/chat_channel.py +++ b/channel/chat_channel.py @@ -431,7 +431,7 @@ class ChatChannel(Channel): if session_id not in self.sessions: self.sessions[session_id] = [ Dequeue(), - threading.BoundedSemaphore(conf().get("concurrency_in_session", 4)), + threading.BoundedSemaphore(conf().get("concurrency_in_session", 1)), ] if context.type == ContextType.TEXT and context.content.startswith("#"): self.sessions[session_id][0].putleft(context) # 优先处理管理命令 diff --git a/config.py b/config.py index ee67126..c808aab 100644 --- a/config.py +++ b/config.py @@ -37,7 +37,7 @@ available_setting = { "group_name_white_list": ["ChatGPT测试群", "ChatGPT测试群2"], # 开启自动回复的群名称列表 "group_name_keyword_white_list": [], # 开启自动回复的群名称关键词列表 "group_chat_in_one_session": ["ChatGPT测试群"], # 支持会话上下文共享的群名称 - "group_shared_session": True, # 群聊是否共享会话上下文(所有成员共享),默认为True。False时每个用户在群内有独立会话 + "group_shared_session": False, # 群聊是否共享会话上下文(所有成员共享)。False时每个用户在群内有独立会话 "nick_name_black_list": [], # 用户昵称黑名单 "group_welcome_msg": "", # 配置新人进群固定欢迎语,不配置则使用随机风格欢迎 "trigger_by_self": False, # 是否允许机器人触发