Skip to content

Commit 754192e

Browse files
author
Miriad
committed
Merge remote-tracking branch 'origin/main' into dev
2 parents 6de084b + b6c94c5 commit 754192e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

app/api/cron/check-research/route.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -940,9 +940,10 @@ export async function GET(request: NextRequest) {
940940
const sanity = getSanityWriteClient();
941941

942942
// Single query for all active pipeline statuses
943-
// Include both researchInteractionId (new Gemini) and researchNotebookId (legacy)
943+
// Docs may reach research_complete without researchInteractionId when deep research
944+
// is disabled or fails — the ID filter only applies to "researching" status
944945
const docs = await sanity.fetch<PipelineDoc[]>(
945-
`*[_type == "automatedVideo" && status in ["researching", "research_complete", "infographics_generating", "enriching"] && (defined(researchInteractionId) || defined(researchNotebookId))] {
946+
`*[_type == "automatedVideo" && status in ["researching", "research_complete", "infographics_generating", "enriching"] && (status != "researching" || defined(researchInteractionId) || defined(researchNotebookId))] {
946947
_id, title, status, researchInteractionId, researchNotebookId, trendScore, trendSources,
947948
script, researchData, infographicProgress, _updatedAt
948949
}`,

0 commit comments

Comments
 (0)