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 1a3166b3
authored
Jul 01, 2026
by
sunqi02
Committed by
胡悦
Jul 01, 2026
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat: 更新 read_pending_messages 文档以更清晰地说明功能,修改 intent_session 为列表以支持多条意图
1 parent
65f3c7d2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
workspace/agent-admin/backend/app/agent_core/agent_hub.py
workspace/agent-admin/backend/app/agent_core/message_gate.py
workspace/agent-admin/backend/app/agent_core/agent_hub.py
View file @
1a3166b
...
@@ -1071,8 +1071,11 @@ class AgentHub:
...
@@ -1071,8 +1071,11 @@ class AgentHub:
async
def
read_pending_messages
()
->
ToolResponse
:
async
def
read_pending_messages
()
->
ToolResponse
:
"""读取在途任务期间到达的新消息。
"""读取在途任务期间到达的新消息。
在 Agent 运行期间,用户可能发送了后续消息。调用此工具获取这些消息,
在 Agent 运行期间,用户可能继续发送后续消息(例如补充对文件的处理要求、
避免追问用户已发送的信息。
追加新的需求或修改原有指令)。调用此工具主动获取这些消息,
避免追问用户已发送的信息或遗漏用户最新的意图。
调用后会清空消息缓冲区,不会重复返回已读消息;无新消息时返回提示。
Returns:
Returns:
在途期间到达的消息列表,无新消息时返回提示
在途期间到达的消息列表,无新消息时返回提示
...
...
workspace/agent-admin/backend/app/agent_core/message_gate.py
View file @
1a3166b
...
@@ -280,7 +280,7 @@ class MessageGate:
...
@@ -280,7 +280,7 @@ class MessageGate:
# 清空 intent_session
# 清空 intent_session
data
=
store
.
get
(
session_id
)
or
{}
data
=
store
.
get
(
session_id
)
or
{}
data
[
"intent_session"
]
=
""
data
[
"intent_session"
]
=
[]
store
.
set
(
session_id
,
data
)
store
.
set
(
session_id
,
data
)
self
.
session_service
.
save_to_db
(
session_id
)
self
.
session_service
.
save_to_db
(
session_id
)
...
@@ -321,6 +321,8 @@ class MessageGate:
...
@@ -321,6 +321,8 @@ class MessageGate:
intent_msgs
=
[{
"role"
:
"user"
,
"content"
:
merged_text
}]
intent_msgs
=
[{
"role"
:
"user"
,
"content"
:
merged_text
}]
data
[
"intent_session"
]
=
intent_msgs
data
[
"intent_session"
]
=
intent_msgs
store
.
set
(
session_id
,
data
)
store
.
set
(
session_id
,
data
)
# 持久化到 DB,防止进程崩溃导致 intent_session 丢失
self
.
session_service
.
save_to_db
(
session_id
)
await
self
.
post_reply_hook
.
execute
({
await
self
.
post_reply_hook
.
execute
({
"agent_name"
:
self
.
main_agent_key
,
"agent_name"
:
self
.
main_agent_key
,
"response_content"
:
BUSY_REPLY
,
"response_content"
:
BUSY_REPLY
,
...
...
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