AI Agents SDE Task Viewer
      • Pr description
  1. Home
  2. AgentSDE
  3. agent-core
  4. gh-443
  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: add EventBusService abstraction backed by Redis pub/sub

Problem#

Cross-process event delivery requires a transport beyond in-process EventEmitter2. This PR introduces a Redis-backed EventBusService that can fan out typed events across multiple processes.

Task / Link#

Closes #443

Changes#

  • src/event-bus/event-bus.events.ts — typed EventMap interface covering all 6 events (task.updated, task.stuck, job.created, job.completed, job.failed, artefacts.synced)
  • src/event-bus/event-bus.service.ts — EventBusService with emit() / on() over Redis pub/sub; errors swallowed in emit(); per-handler error isolation in on()
  • src/event-bus/event-bus.module.ts — @Global() module factory-providing two ioredis clients (pub + sub) from REDIS_HOST/REDIS_PORT/REDIS_DB config
  • src/event-bus/index.ts — barrel export
  • src/event-bus/event-bus.service.spec.ts — 7 unit tests covering publish, subscribe, multi-handler dispatch, error isolation, and onModuleDestroy()
  • src/app.module.ts — registers EventBusModule

Notes#

  • Runs alongside existing EventEmitter2 — no existing emitters or listeners are changed
  • Channel prefix agentsde:events: scopes all channels to this application
  • emit() is fire-and-forget: Redis errors are logged and swallowed — pipeline advancement is not blocked by event delivery

Testing#

  • 7 new unit tests — all pass
  • Full test suite (807 tests) — all pass
  • npm run lint — zero warnings
PrdAi-done