AI Agents SDE Task Viewer
      • Pr description
  1. Home
  2. AgentSDE
  3. agent-core
  4. gh-457
  5. changes
  6. pr_description.md
pr_description.md(1.5 KB)· Apr 13, 2026· 1 min read
  • Title
  • Problem
  • Task / Link
  • Changes
  • Notes
  • Testing

Title#

feat: implement BullMQ job queue driver behind JOB_QUEUE_DRIVER config flag

Problem#

The job queue is backed by SQLite, which limits scalability and reliability. AW-11 introduces a BullMQ/Redis-backed implementation that can be switched in at runtime without breaking the existing SQLite path.

Task / Link#

Closes #457

Changes#

  • Add JOB_QUEUE_DRIVER Joi validation to config.schema.ts (valid: sqlite | bullmq, default: sqlite)
  • Create BullMQJobQueue implementing the JobQueue interface using BullMQ Queue + Worker
  • Lazy Redis connection: Queue and Worker are only instantiated when first used, so driver=sqlite never opens a Redis connection
  • Per-issue concurrency control via in-memory activeIssues Set; BullMQ concurrency: 1 ensures sequential processing
  • Update QueueModule factory provider to select BullMQJobQueue or SqliteJobQueue based on JOB_QUEUE_DRIVER
  • Export BullMQJobQueue from the queue index

Notes#

  • BullModule.forRootAsync is NOT added to QueueModule — BullMQJobQueue manages its own IORedis connections directly, matching the lazy-init design and avoiding module-level conflicts with InvokeModule. This remains a follow-up for AW-3 (#439).
  • Both queue implementations are registered as providers; lazy init prevents Redis connections when using the SQLite driver.

Testing#

  • 13 new unit tests in bullmq-job-queue.spec.ts covering: enqueue, onJob/worker init, per-issue dedup, error handling, and onModuleDestroy cleanup
  • Full test suite: 824 tests pass
  • Lint: zero warnings
PrdAi-done