fix(reprocess): include 'analyzed' status in 'all' scope + new 'analyzed' scope

Previously 'all' missed status='analyzed', so re-running v2 prompts on existing
analyzed sessions returned 0 reset.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Semih
2026-05-16 11:15:37 +03:00
parent 752e69cd01
commit f6727665a3

View File

@@ -16,12 +16,14 @@ export async function POST(req: Request) {
// Reset session status so the pipeline picks them up again with the new v1.2 logic.
const where =
scope === "all"
? { status: { in: ["tagged", "compressed", "discarded"] as string[] } }
? { status: { in: ["tagged", "compressed", "discarded", "analyzed"] as string[] } }
: scope === "compressed"
? { status: "compressed" }
: scope === "discarded"
? { status: "discarded" }
: { status: { in: ["tagged", "discarded"] as string[] } };
: scope === "analyzed"
? { status: "analyzed" }
: { status: { in: ["tagged", "discarded"] as string[] } };
const candidates = await prisma.sessionMeta.findMany({
where,