feat(M5-008,M6-001-005): session hardening tests + BullMQ job queue foundation
Some checks failed
ci/woodpecker/push/ci Pipeline failed
ci/woodpecker/pr/ci Pipeline failed

- M5-008: Add session-hardening.test.ts verifying /model switch, /agent switch,
  session resume with conversationHistory, and metrics tracking (tokens + message count)
- M6-001: Install bullmq, configure connection via VALKEY_URL (redis://localhost:6380)
- M6-002: Create QueueService (apps/gateway/src/queue/) with typed job definitions
  (SummarizationJob, GCJob, TierManagementJob), worker registration with exponential
  backoff, queue health status, and admin API helpers (listJobs, retryJob, pause/resume)
- M6-003: Migrate summarization cron → BullMQ repeatable job (SUMMARIZATION_CRON env)
- M6-004: Migrate session GC cron → BullMQ repeatable job (SESSION_GC_CRON env)
- M6-005: Migrate tier management cron → BullMQ repeatable job (TIER_MANAGEMENT_CRON env)
- Add AdminJobsController for queue/job management at /api/admin/jobs
- All three quality gates pass: typecheck, lint, format:check
- 319 tests pass

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-22 20:15:56 -05:00
parent 701bb69e6c
commit bfc97422c7
13 changed files with 1458 additions and 31 deletions

View File

@@ -22,6 +22,7 @@ import { PreferencesModule } from './preferences/preferences.module.js';
import { GCModule } from './gc/gc.module.js';
import { ReloadModule } from './reload/reload.module.js';
import { WorkspaceModule } from './workspace/workspace.module.js';
import { QueueModule } from './queue/queue.module.js';
import { ThrottlerGuard, ThrottlerModule } from '@nestjs/throttler';
@Module({
@@ -46,6 +47,7 @@ import { ThrottlerGuard, ThrottlerModule } from '@nestjs/throttler';
PreferencesModule,
CommandsModule,
GCModule,
QueueModule,
ReloadModule,
WorkspaceModule,
],