From 7db9eb29a0998eec4d2fdf34aaf0104c8532baa0 Mon Sep 17 00:00:00 2001 From: iven Date: Thu, 16 Apr 2026 17:29:16 +0800 Subject: [PATCH] =?UTF-8?q?fix(butler):=20useButlerInsights=20=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=20resolvedAgentId=20=E6=9F=A5=E8=AF=A2=E7=97=9B?= =?UTF-8?q?=E7=82=B9/=E6=96=B9=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 审计发现 useButlerInsights 仍使用原始 agentId("1")查询痛点, 而痛点按 kernel UUID 存储导致空结果。改用 effectiveAgentId (resolvedAgentId ?? agentId)确保查询路径一致。 Co-Authored-By: Claude Opus 4.6 --- desktop/src/components/ButlerPanel/index.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/desktop/src/components/ButlerPanel/index.tsx b/desktop/src/components/ButlerPanel/index.tsx index d84886d..6e063ed 100644 --- a/desktop/src/components/ButlerPanel/index.tsx +++ b/desktop/src/components/ButlerPanel/index.tsx @@ -13,12 +13,15 @@ interface ButlerPanelProps { } export function ButlerPanel({ agentId }: ButlerPanelProps) { - const { painPoints, proposals, loading, error, refresh } = useButlerInsights(agentId); + const [resolvedAgentId, setResolvedAgentId] = useState(null); + // Use resolved kernel UUID for queries — raw agentId may be "1" from SaaS relay + // while pain points/proposals are stored under kernel UUID + const effectiveAgentId = resolvedAgentId ?? agentId; + const { painPoints, proposals, loading, error, refresh } = useButlerInsights(effectiveAgentId); const messageCount = useChatStore((s) => s.messages.length); const { accountIndustries, configs, lastSynced, isLoading: industryLoading, fetchIndustries } = useIndustryStore(); const [analyzing, setAnalyzing] = useState(false); const [memoryRefreshKey, setMemoryRefreshKey] = useState(0); - const [resolvedAgentId, setResolvedAgentId] = useState(null); // Resolve SaaS relay agentId ("1") to kernel UUID for VikingStorage queries useEffect(() => {