Production-grade Postgres job queue - #1
Merged
Merged
Conversation
Extends the Prisma schema with a DEAD_LETTER variant in JobStatus for jobs that exhaust all retry attempts, and an optional progress field (0-100) for tracking job completion percentage. Adds an index on type for efficient scheduler duplicate checks.
Replaces the original generic job types with the five concrete types needed by Outpost: AI_RESPONSE, TICKET_CLASSIFY, SLA_CHECK, ESCALATION, and ONBOARDING_DIGEST. Each type has a dedicated payload interface. Adds JobHandlerContext for progress reporting, WorkerOptions for concurrency/timeout config, WorkerHealthStatus, and ScheduledJobDefinition.
…ter queue Adds graceful shutdown (SIGTERM/SIGINT), configurable per-job-type timeouts, concurrent job processing with configurable max concurrency, dead letter queue (DEAD_LETTER status after maxAttempts), job progress tracking via handler context, and a health check method reporting worker status, active jobs, and last poll time.
Creates a Scheduler class that manages recurring jobs using simple interval timers. Includes default definitions for SLA_CHECK (every 5 minutes) and ONBOARDING_DIGEST (daily). Prevents duplicate scheduling by checking for existing PENDING/PROCESSING jobs before creating new ones.
Tests cover createJob defaults and options, progress clamping, worker job processing, dead letter queue after max attempts, retry with backoff, job timeout, missing handler handling, concurrency limits, health checks, graceful shutdown, progress reporting via handler context, scheduler creation and deduplication, recurring intervals, and date injection for digest jobs. Uses vitest with mocked Prisma.
9 tasks
NathanTarbert
added a commit
that referenced
this pull request
Jul 2, 2026
First card line is now a one-line italic caption (no label) that says
what the thing actually is, in a human sentence a non-engineer would
say — the "in one breath" gist, above What. Explicitly NOT agent/meta
("Landed Top issue #1, score 13, mirrored into Enterprise") — the
placement is already obvious from where the card sits. ~8-18 words,
plain, no jargon dump.
NathanTarbert
added a commit
that referenced
this pull request
Jul 17, 2026
Addresses PR #113 review nit #1: the App-credential describe block's insertion had re-parented the existing 'posts to discussions via GraphQL (GITHUB_DISCUSSION)' postSystemMessage test into the new describe. Moved it back under postSystemMessage; App-credential now ends at the throws-on-incomplete-creds test. Test-only; 19 platform-adapter tests pass.
This was referenced Jul 18, 2026
NathanTarbert
added a commit
that referenced
this pull request
Aug 14, 2026
… the claim A source link can resolve, carry the right issue number, and match its quoted title while still being the wrong evidence. Both existing link-review checks passed exactly that case on the Aug 07-14 report. Top issue #1 ("merged AG-UI fixes aren't reaching npm") was sourced to ag-ui#2305 and #2306 — two tool-error adapter bugs, both closed and fixed. Following them showed completed work and nothing about publishing, so a reader reasonably concluded the whole item was already resolved. Coverage checked that links existed; correctness checked that numbers matched titles; neither asked whether the linked issue evidenced the sentence beside it. Adds a third mandatory check to step 14, and a companion rule: cite the artifact that carries the evidence — for a release problem that's the merged PRs plus registry output, not the issues those PRs closed. Also adds a preview-channel warning. pkg.pr.new, TestPyPI and canary/.dev bot comments make a merged PR look published; only a stable version on npm's latest dist-tag or PyPI's info.version counts as released. Report corrected in Notion: re-sourced to PRs #2330/#2335/#2316/#2317 plus npm and PyPI timestamps, "Fix plan: Not started" replaced (the engineering is done, only the release is outstanding), @ag-ui/core removed as unevidenced, and @ag-ui/mastra and @ag-ui/langchain added — mastra had been used as an unaffected carve-out when two of the four PRs touch it.
This was referenced Aug 14, 2026
Open
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.
Summary
Schema changes
JobStatusenum: addedDEAD_LETTERJobmodel: addedprogress Int?, added@@index([type])Test plan