feat: 保存子智能体产生的所有消息到数据库,增强消息持久化功能
This commit is contained in:
parent
881c73c79f
commit
1dcdd24519
@ -188,6 +188,13 @@ impl DefaultSubAgentRuntime {
|
|||||||
|
|
||||||
match result {
|
match result {
|
||||||
Ok(Ok(process_result)) => {
|
Ok(Ok(process_result)) => {
|
||||||
|
// 保存子智能体产生的所有消息到数据库
|
||||||
|
for message in &process_result.emitted_messages {
|
||||||
|
if let Err(e) = self.conversation_repository.append_message(&session.session_id, message) {
|
||||||
|
tracing::warn!(error = %e, session_id = %session.session_id, "Failed to append subagent message");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let final_message = process_result.final_response;
|
let final_message = process_result.final_response;
|
||||||
Ok(TaskToolResult {
|
Ok(TaskToolResult {
|
||||||
status: "success".to_string(),
|
status: "success".to_string(),
|
||||||
@ -232,6 +239,13 @@ impl DefaultSubAgentRuntime {
|
|||||||
|
|
||||||
match result {
|
match result {
|
||||||
Ok(Ok(process_result)) => {
|
Ok(Ok(process_result)) => {
|
||||||
|
// 保存子智能体产生的所有消息到数据库
|
||||||
|
for message in &process_result.emitted_messages {
|
||||||
|
if let Err(e) = self.conversation_repository.append_message(&session.session_id, message) {
|
||||||
|
tracing::warn!(error = %e, session_id = %session.session_id, "Failed to append subagent message");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let final_message = process_result.final_response;
|
let final_message = process_result.final_response;
|
||||||
Ok(TaskToolResult {
|
Ok(TaskToolResult {
|
||||||
status: "success".to_string(),
|
status: "success".to_string(),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user