refactor(agent): optimize ULID id sorting and exclude __CHAT__ placeholder comments

This commit is contained in:
yiling
2026-07-29 14:59:48 +08:00
parent a756f7dc2a
commit 1c7a87488b
4 changed files with 41 additions and 6 deletions
+5 -2
View File
@@ -28,8 +28,11 @@ export const createReadThreadTool = (): AgentTool<
}
const replies = await prisma.assetComment.findMany({
where: { replyToId: rootComment.id },
orderBy: { createdAt: 'asc' },
where: {
replyToId: rootComment.id,
message: { not: '__CHAT__' },
},
orderBy: { id: 'asc' },
include: { creator: true },
})