debug: 添加消息数组追踪日志
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
fbe797d436
commit
1dd9500f22
@ -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 (
|
||||
<div className="relative flex-1">
|
||||
<div
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user