perf(agent): optimize active task lookup using indexed sessionId column

This commit is contained in:
yiling
2026-07-14 15:44:10 +08:00
parent cd48d2d389
commit a7dc7bbff2
13 changed files with 69 additions and 27 deletions
+2
View File
@@ -629,6 +629,7 @@ model WorkflowTask {
inputTokens Int @default(0) @map("input_tokens")
outputTokens Int @default(0) @map("output_tokens")
model String?
sessionId String? @map("session_id")
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
@@ -638,6 +639,7 @@ model WorkflowTask {
@@index([teamId])
@@index([projectId])
@@index([type])
@@index([sessionId])
}
enum AgentType {
chat