[codex] Detect overdue scheduled retries - #1210
Conversation
Expose a per-agent gauge and alert for scheduled retries that remain parked after their due time, with an online-safe index for the scrape query. Co-Authored-By: Paperclip <noreply@paperclip.ing>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
@ally head Requested a review from @allyblockcast directly (native GitHub review request, not just this comment) against current head |
There was a problem hiding this comment.
Ally — Consolidated PR Review
Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex.
Reviewed head: 4e81494
Critical Issues (0)
Important Issues (0)
Suggestions (0)
Strengths
- The metric refresh derives overdue age from
scheduled_retry_at, explicitly resets healthy agents to zero, and keeps the Prometheus series agent-keyed. - The migration avoids taking a blocking index-build path on populated tables and validates the concurrently precreated index definition before recording the migration.
- Tests cover overdue age, future retries, promoted retries, per-agent oldest selection, and both valid and invalid migration prerequisites.
Recommended Action
- No Critical or Important issues found; this review is clean for the reviewed head.
|
Superseded by changes already landed on current master; no code from this PR should be merged. Closing to remove the stale approved/conflicted entry from the merge queue.\n\n- #970: equivalent authz guard is in master via BLO-22909 / commit fdaa976.\n- #960: intended recovery changes are in master via merged #1489.\n- #1210: intended overdue scheduled-retry changes are in master via merged #1184 and subsequent hardening. |
Pull request was closed
Thinking Path
Linked Issues or Issue Description
Refs: BLO-22094
Supersedes the app-authored implementation in #1184. Its stacked #1019 prerequisite is not on current
master; this PR ports only the overdue scheduled-retry functionality that current master already supports.What Changed
/metricsrefresh that reports the oldest due-but-unpromotedscheduled_retryage per agent and explicitly resets healthy agents to zero.PaperclipOverdueScheduledRetry, configurable threshold/runbook values, Helm rendering coverage, and an operator runbook.status = 'scheduled_retry'lookups, plus migration regression tests for populated and invalid-precreated-index cases.Verification
pnpm --filter @paperclipai/db run check:migrationspnpm --filter @paperclipai/server exec vitest run src/__tests__/overdue-scheduled-retry-metrics.test.ts --reporter=verbose— 4 passedpnpm --filter @paperclipai/db exec vitest run src/heartbeat-runs-overdue-scheduled-retry-index-migration.test.ts --reporter=verbose— 3 passednode --test deploy/helm/paperclip/tests/prometheus-rule.test.mjs— 7 passedpnpm --filter @paperclipai/server exec tsc --noEmit -p .pnpm --filter @paperclipai/db typecheckpnpm --filter @paperclipai/server buildRisks
(agent_id, scheduled_retry_at)index restricted tostatus = 'scheduled_retry'prevents historical-table scans. Populated production databases must precreate that index concurrently, as the migration explicitly requires.prometheusRule.enabledis false. Landing the live onprem monitoring copy and syncing it are intentionally out of scope for this repository-only successor.Model Used
OpenAI Codex, GPT-5. Tool-assisted implementation, test execution, and GitHub inspection; the context-window size is not surfaced by this environment.
Checklist
Fixes: #/Closes #/Refs #OR (b) described the issue in-PR following the relevant issue template