From 1dd9500f22d1744979922057ba940f0b9bd57d05 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 1 Feb 2026 02:40:20 +0800 Subject: [PATCH] =?UTF-8?q?debug:=20=E6=B7=BB=E5=8A=A0=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=95=B0=E7=BB=84=E8=BF=BD=E8=B8=AA=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- components/messages.tsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/components/messages.tsx b/components/messages.tsx index 7bade6d64..f6518634d 100644 --- a/components/messages.tsx +++ b/components/messages.tsx @@ -283,6 +283,20 @@ function PureMessages({ prevMessagesLengthRef.current = messages.length; }, [messages, scrollToBottom]); + // 🔍 调试:追踪消息数组变化 + useEffect(() => { + console.log("[Messages] 📋 消息数组更新:", { + count: messages.length, + messages: messages.map(m => ({ + id: m.id?.substring(0, 8), + role: m.role, + partsCount: m.parts?.length, + firstPartType: m.parts?.[0]?.type, + firstPartText: m.parts?.[0]?.type === "text" ? m.parts[0].text?.substring(0, 50) : undefined + })) + }); + }, [messages]); + return (