Skip to content

feat: migrate cron routes to Sanity config singletons (Phase B)#613

Merged
codercatdev merged 1 commit intodevfrom
feat/config-migration-cron-v2
Mar 5, 2026
Merged

feat: migrate cron routes to Sanity config singletons (Phase B)#613
codercatdev merged 1 commit intodevfrom
feat/config-migration-cron-v2

Conversation

@codercatdev
Copy link
Contributor

Phase B: Cron Route Config Migration

Migrates hardcoded values and process.env tweakable config to Sanity config singletons via getConfig() / getConfigValue().

Files Changed (2)

app/api/cron/ingest/route.ts (+31/-5)

  • process.env.ENABLE_NOTEBOOKLM_RESEARCHgetConfigValue("pipeline_config", "enableNotebookLmResearch", false)
  • Hardcoded quality threshold < 50getConfigValue("pipeline_config", "qualityThreshold", 50)
  • SYSTEM_INSTRUCTION constant → getConfigValue("content_config", "systemInstruction", SYSTEM_INSTRUCTION_FALLBACK)

app/api/cron/check-research/route.ts (+34/-10)

  • STUCK_THRESHOLDS constant → buildStuckThresholds() reads stuckTimeoutMinutes from pipeline_config (fallback: 30min, ratios: 100%/50%/33%)
  • Hardcoded quality threshold < 50getConfigValue("pipeline_config", "qualityThreshold", 50)
  • SYSTEM_INSTRUCTION constant → getConfigValue("content_config", "systemInstruction", SYSTEM_INSTRUCTION_FALLBACK)

NOT in this PR

  • check-renders/route.ts — audited, no tweakable config to migrate (Remotion/ElevenLabs config is in service layer, owned by @videopipe)

What stays as process.env (intentionally NOT migrated)

  • CRON_SECRET — auth secret
  • ANTHROPIC_API_KEY — API key
  • SANITY_API_TOKEN — API key

Pattern

All values use getConfigValue() with existing hardcoded values as fallbacks, so nothing breaks if the Sanity singletons aren't populated yet.

Closes old PR #610 (had sandbox contamination from shared sandbox branch-switching).

Ingest route: ENABLE_NOTEBOOKLM_RESEARCH, quality threshold, system
instruction now read from pipeline_config and content_config singletons.

Check-research route: stuck thresholds, quality threshold, system
instruction now configurable via Sanity.

Check-renders route: audited, no tweakable config (Remotion/ElevenLabs
config is in service layer).

All values use getConfigValue() with existing hardcoded values as
fallbacks for graceful degradation.

Co-authored-by: research <research@miriad.systems>
@vercel
Copy link

vercel bot commented Mar 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
codingcat-dev Ignored Ignored Mar 5, 2026 6:17am

@codercatdev codercatdev merged commit a873a90 into dev Mar 5, 2026
2 of 3 checks passed
@codercatdev codercatdev deleted the feat/config-migration-cron-v2 branch March 5, 2026 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant