Title#
feat: implement #459 — AW-13: Migrate from SqliteJobQueue to BullMQJobQueue and remove SQLite queue
Problem#
The agent-core job queue was backed by SQLite (SqliteJobQueue), which required an in-process
database table and manual stale-job recovery on restart. Completing the AW-10 epic requires
replacing this with a Redis-backed BullMQ implementation and removing all SQLite queue infrastructure.
Task / Link#
Closes #459 — AW-13: Migrate from SqliteJobQueue to BullMQJobQueue and remove SQLite queue Part of AW-10 epic (#456)
Changes#
- Created
BullMQJobQueueimplementingJobQueueinterface using BullMQQueue+Worker(concurrency: 1) - Deleted
SqliteJobQueue, its spec, andJobEntity— no more SQLite jobs table - Updated
QueueModuleto provideBullMQJobQueueas the soleJOB_QUEUEprovider - Updated
OperationalControllermetrics endpoint to useBullMQJobQueue.getQueue().getJobCounts()instead of TypeORM repo - Updated
JobsControllerto introspect the BullMQ queue (list, get, retry, cancel) instead of TypeORM queries - Cleaned up all
JobEntityreferences across database module, control-api module, and spec files - Updated
.env.exampleto document Redis vars; removedJOB_QUEUE_DRIVER(no longer needed)
Notes#
- Job IDs in
GET /api/cc/jobs/:idare now strings (BullMQ IDs), not integers — breaking change for that endpoint - Metrics endpoint
GET /internal/metricsjob counts now use BullMQ states (waiting,active,completed,failed,delayed) instead of SQLite states - Worker uses
concurrency: 1— serial processing, one job at a time; different from SQLite which allowed per-issue concurrency - BullMQ stalled job auto-retry replaces the manual
onModuleInitrecovery inSqliteJobQueue
Testing#
- Unit tests updated: 807 tests pass, 0 failures
BullMQJobQueueunit spec added with mocked bullmqoperational.e2e-spec.tsrewritten to mockBullMQJobQueuefor metricsjob-queue.e2e-spec.tsrewritten forBullMQJobQueuebehaviour