fix(frontier-digest): stop the proposals phase blocking the cron's HTTP response - #446
Merged
Merged
Conversation
…TP response fc-cron@frontier-digest.service was failing with curl exit 28 (120s timeout, 0 bytes received): the route awaited runFrontierProposals() synchronously, and that phase's model calls retry across a multi-vendor fallback chain (lib/groq.ts's fallback: true default), each burning its full per-link timeout on a degraded link — easily exceeding the cron wrapper's fixed `curl -m 120` even though ingest+digest (the public-facing half) finish in well under 30s. Confirmed live: production's /frontier page already showed today's real digest while the systemd unit still sat failed, proving the digest half was fast and the proposals phase was what blocked the response. Detach the proposals call (fire-and-forget into a new logProposalsOutcome helper) so the cron gets its response as soon as the digest is saved. Proposals still run to completion and get logged via logDebug exactly as before — just asynchronously, which is safe here since this is a persistent systemd-managed server, not serverless. No box-side change needed; deploying this alone fixes it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause
fc-cron@frontier-digest.serviceon the box failed this morning withcurlexit 28 — a 120s timeout with 0 bytes received.scripts/install-hetzner-crons.shgenerates/opt/fleetcrown/fc-cron.sh, which calls this route withcurl -m 120.The route awaited
runFrontierProposals()synchronously before responding. That phase's model calls (generateProposals+ the judge panel insrc/lib/frontier/propose.ts) retry across a multi-vendor fallback chain (src/lib/groq.ts'sfallback: truedefault), and each link burns its full per-link timeout before falling through on a degraded link. That alone can exceed two minutes, even though the public-facing digest half (ingest + rank,ingest.ts+digest.ts) reliably finishes in well under 30s.Confirmed empirically rather than just from reading the timeouts: production's
/frontierpage already showed today's (2026-08-30) real digest content whilesystemctl status fc-cron@frontier-digest.servicestill showedfailed. That proves the digest half succeeded fast — the proposals phase was what held the HTTP response past the cron's 120s ceiling.Fix
Detach the
runFrontierProposals()call — fire-and-forget, chained into a newlogProposalsOutcomehelper via.catch().then()— so the route returns as soon as the digest is saved. Proposals still run to completion and are still logged vialogDebugexactly as before, just asynchronously. This is safe because the app runs as a persistent systemd-managed Next.js server, not serverless — the process keeps running after the response is flushed.The JSON response's
proposalsfield now reads"queued — outcome logged separately"instead of the full result object, since the result isn't known synchronously anymore. Nothing else in the repo parses that field (grepped) — onlyfc-cron.shlogs the raw response body as text.Why no box-side change
scripts/install-hetzner-crons.sh/ the box's/opt/fleetcrown/fc-cron.share untouched. Deploying this route.ts change alone fixes it: the wrapper'scurl -m 120will now always get a fast reply regardless of how slow/degraded the proposals-phase model chain is that day.Verification
npx tsc --noEmit: 0 errors.npx eslinton staged files) and pre-push (full local verify gate, includingtest:home,check:schema, dogfood-skip) both passed.proposalsresponse field.🤖 Generated with Claude Code