Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
ai
/
ai-workflow
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit babf6e64
authored
Jun 12, 2026
by
sunqi02
Committed by
胡悦
Jul 01, 2026
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat: auto-complete mouth agent code (-1) in allowed_agent_codes
1 parent
28190282
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
workspace/agent-admin/backend/app/api/v1/endpoints/agent_hub.py
workspace/agent-admin/backend/app/api/v1/endpoints/agent_hub.py
View file @
babf6e6
...
@@ -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
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment