fix: 智能体历史使用记录只显示真正有对话的智能体
This commit is contained in:
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user