From f48f4ec8e26cda12432a415963e94ce1e98a47ee Mon Sep 17 00:00:00 2001 From: ji ruo <79234113+RuoJi6@users.noreply.github.com> Date: Fri, 30 Oct 2026 12:27:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BB=91=E5=AE=9A=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E8=A7=A6=E5=8F=91=E7=9A=84=E6=8A=A5=E5=91=8A=E6=92=B0=E5=86=99?= =?UTF-8?q?=E5=AF=B9=E8=AF=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/orchestration.go | 6 ++++++ web/src/components/finding-auto-chat.tsx | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/server/orchestration.go b/server/orchestration.go index 9f62f7e..7e7fd60 100644 --- a/server/orchestration.go +++ b/server/orchestration.go @@ -11,6 +11,7 @@ import ( "github.com/Autumn-27/artex/agent" "github.com/Autumn-27/artex/db" + "github.com/Autumn-27/artex/intercept" "github.com/Autumn-27/norma/permission" actool "github.com/Autumn-27/norma/tool" ) @@ -479,6 +480,11 @@ func (s *Server) toolUpdateFindingReport() actool.CoreTool { return actool.Errorf("归档报告截图失败: " + err.Error()), nil } } + if conversationID := intercept.ConvIDFromContext(ctx); conversationID > 0 { + if err := s.m.pg.SetFindingReportConversationID(fid, conversationID); err != nil { + return actool.Errorf("关联报告对话失败: " + err.Error()), nil + } + } } n, err := s.m.pg.SetFindingReportVersionByNodeID(ctx, nodeID, a.Report, a.EvidenceVersion) if err != nil { diff --git a/web/src/components/finding-auto-chat.tsx b/web/src/components/finding-auto-chat.tsx index c92c016..6e864e4 100644 --- a/web/src/components/finding-auto-chat.tsx +++ b/web/src/components/finding-auto-chat.tsx @@ -76,7 +76,7 @@ export function FindingAutoChat({ setConversation({ id: initialConversationId, agent_key: agentKey, title: `漏洞 #${findingId} · ${safeTitle}`, created_at: "", updated_at: "" }); return; } - const storedID = Number(window.localStorage.getItem(storageKey)); + const storedID = agentKey === "auto" ? Number(window.localStorage.getItem(storageKey)) : 0; if (Number.isSafeInteger(storedID) && storedID > 0) { setConversation({ id: storedID,