Commit babf6e64 by sunqi02 Committed by 胡悦

feat: auto-complete mouth agent code (-1) in allowed_agent_codes

1 parent 28190282
...@@ -115,6 +115,12 @@ async def chat( ...@@ -115,6 +115,12 @@ async def chat(
if not allowed_agent_codes: if not allowed_agent_codes:
allowed_agent_codes = None # 无有效子 agent,走默认路由 allowed_agent_codes = None # 无有效子 agent,走默认路由
# 后端自动补全发言人口 agent code,确保主Agent 始终可调用发言人
MOUTH_AGENT_CODE = "-1"
if allowed_agent_codes is not None and MOUTH_AGENT_CODE not in allowed_agent_codes:
if MOUTH_AGENT_CODE in agent_hub.agents:
allowed_agent_codes.append(MOUTH_AGENT_CODE)
# 4. 追加消息到 buffer(在 BackgroundTask 之外,确保锁外追加) # 4. 追加消息到 buffer(在 BackgroundTask 之外,确保锁外追加)
from app.service.session_buffer import SessionBuffer from app.service.session_buffer import SessionBuffer
from app.infrastructure.session_store import SessionStore from app.infrastructure.session_store import SessionStore
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!