Skip to content

Commit dee0f4b

Browse files
author
Miriad
committed
fix: GROQ filter no longer requires researchInteractionId for non-researching docs
Docs reaching research_complete without deep research (disabled or failed) were invisible to check-research. The ID requirement now only applies to 'researching' status — research_complete, infographics_generating, and enriching docs are always picked up.
1 parent a29eb36 commit dee0f4b

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
@@ -935,9 +935,10 @@ export async function GET(request: NextRequest) {
935935
const sanity = getSanityWriteClient();
936936

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

0 commit comments

Comments
 (0)