Skip to content

feat(workers): reconstruct scheduled-cast senders (gated off) - #12

Merged
arcabotai merged 1 commit into
mainfrom
feat/scheduled-senders
May 30, 2026
Merged

arcabotai merged 1 commit into
mainfrom
feat/scheduled-senders

Conversation

@arcabotai

Copy link
Copy Markdown
Owner

Summary

Rebuilds the two scheduled-send workers that were stubbed out of the fork, fully inert until deliberately enabled.

  • src/scripts/sendScheduledDrafts.ts — sends due Drafts (sendStatus=SCHEDULED, nextScheduledAt<=now) via the existing @/utils/drafts sendDraftToFarcaster, which already handles recurring reschedule, scheduled reactions, and error states.
  • src/scripts/sendScheduledCasts.ts — sends due ScheduledCast rows (status=PENDING, scheduledAt<=now) via the Neynar client with idempotency keys. Standalone casts only; thread-grouped casts are a documented follow-up.

Safety

  • Both routes keep the CRON_SECRET guard and are gated behind CASTORA_ENABLE_SCHEDULED_SENDER (off by default) and are not in vercel.json crons → they post nothing until you set the flag and add a cron. Merging is inert.
  • End-to-end posting was intentionally not run (it would post real casts). Verify against a test account / empty schedule before enabling.
  • No changelog entry — not user-facing until turned on (per AGENTS.md golden rule).

Verification

  • npm run typecheck passes; both routes compile and return 401 without auth.

To enable later

Set CASTORA_ENABLE_SCHEDULED_SENDER=true in Vercel and add cron entries (e.g. */5 * * * *) to vercel.json.

Rebuild the two scheduled-send workers that were stubbed out of the fork:
- src/scripts/sendScheduledDrafts.ts: sends due Drafts (sendStatus=SCHEDULED,
  nextScheduledAt<=now) via existing @/utils/drafts sendDraftToFarcaster, which
  handles recurring reschedule + scheduled reactions + error states.
- src/scripts/sendScheduledCasts.ts: sends due ScheduledCast rows (status=PENDING,
  scheduledAt<=now) directly via the Neynar client, with idempotency keys.
  Standalone casts only; thread-grouped casts are a follow-up.

Both routes keep the CRON_SECRET guard and are gated behind
CASTORA_ENABLE_SCHEDULED_SENDER (off by default) AND are NOT in vercel.json crons,
so they are fully inert until deliberately enabled. typecheck passes; routes
compile and 401 without auth. End-to-end posting intentionally untested (would
post real casts) — verify on a test account before enabling. No changelog entry
yet: not user-facing until turned on.
@vercel

vercel Bot commented May 30, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
castora Ready Ready Preview, Comment May 30, 2026 1:10am

@arcabotai
arcabotai merged commit bf2d4b1 into main May 30, 2026
6 checks passed

This branch was successfully deployed

1 active deployment
Preview — 40bf1751 Deployed May 30, 2026 by vercel[bot]
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