diff --git a/www/app.js b/www/app.js index 77c1e0d..4c19853 100644 --- a/www/app.js +++ b/www/app.js @@ -263,9 +263,10 @@ function getRemainingQuota() { } // 获取使用智能体的对话列表(按时间倒序) +// 只返回真正有对话消息的记录(messages.length > 0) function getAgentConversationHistory(limit = 5) { return conversations - .filter(conv => conv.agentId) // 筛选有智能体的对话 + .filter(conv => conv.agentId && conv.messages && conv.messages.length > 0) // 筛选有智能体且有消息的对话 .sort((a, b) => b.updatedAt - a.updatedAt) // 按更新时间倒序 .slice(0, limit) .map(conv => {