From 1dcdd24519ffe1cbafaa4ddbb49bb1502c790912 Mon Sep 17 00:00:00 2001 From: oudecheng <13802883547@139.com> Date: Wed, 20 May 2026 16:23:24 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=9D=E5=AD=98=E5=AD=90=E6=99=BA?= =?UTF-8?q?=E8=83=BD=E4=BD=93=E4=BA=A7=E7=94=9F=E7=9A=84=E6=89=80=E6=9C=89?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E5=88=B0=E6=95=B0=E6=8D=AE=E5=BA=93=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=BC=BA=E6=B6=88=E6=81=AF=E6=8C=81=E4=B9=85=E5=8C=96?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tools/task/runtime.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/tools/task/runtime.rs b/src/tools/task/runtime.rs index 7fd60a8..505f2e0 100644 --- a/src/tools/task/runtime.rs +++ b/src/tools/task/runtime.rs @@ -188,6 +188,13 @@ impl DefaultSubAgentRuntime { match 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; Ok(TaskToolResult { status: "success".to_string(), @@ -232,6 +239,13 @@ impl DefaultSubAgentRuntime { match 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; Ok(TaskToolResult { status: "success".to_string(),