Opus finding
loadOpenPrs threshold lets first poll happen immediately but cron handler may starve outgoing-PR polls under sweep timeout
- apps/web/app/api/cron/sweep/route.ts:19-90
- apps/web/lib/outgoing-prs.ts:100-135
pollOutgoingPrs iterates sequentially over open rows with a synchronous GitHub call each (~300-600ms typical). The cron tick already does sweep (potentially close to 60s) + onboarder (~30s per candidate) + outgoing PRs. If outgoing_prs ever grows beyond a few dozen rows, the 180s ceiling becomes plausible to exceed and the route returns nothing. The 1-hour poll interval and the cron's hourly cadence currently limit total work, but the design has no upper bound on rows polled per tick.
Recommendation
Add a per-tick budget (e.g. limit loadOpenPrs to N=20 oldest-lastPolledAt rows) and/or run outgoing-PR polling on a separate cron route to isolate timeout risk.