mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-03 06:24:30 +00:00
refactor(agent): optimize ULID id sorting and exclude __CHAT__ placeholder comments
This commit is contained in:
@@ -547,14 +547,14 @@ export async function initializeAgentSessionActivity(params: {
|
||||
})
|
||||
}
|
||||
|
||||
// 1. Fetch top-level comments up to rootComment.createdAt
|
||||
// 1. Fetch top-level comments up to rootComment.createdAt sorted by id
|
||||
const topLevelComments = await prisma.assetComment.findMany({
|
||||
where: {
|
||||
assetId: userComment.assetId,
|
||||
replyToId: null,
|
||||
createdAt: { lte: rootComment.createdAt },
|
||||
},
|
||||
orderBy: { createdAt: 'asc' },
|
||||
orderBy: { id: 'asc' },
|
||||
include: { creator: true },
|
||||
})
|
||||
|
||||
@@ -566,7 +566,7 @@ export async function initializeAgentSessionActivity(params: {
|
||||
createdAt: { lte: userComment.createdAt },
|
||||
id: { not: userComment.id },
|
||||
},
|
||||
orderBy: { createdAt: 'asc' },
|
||||
orderBy: { id: 'asc' },
|
||||
include: { creator: true },
|
||||
})
|
||||
: []
|
||||
|
||||
Reference in New Issue
Block a user