feat(DIS-103): ChannelQueue serializes messages per channel (FIFO) #48

Merged
dev merged 1 commit from phase-1/channel-queue into main 2026-04-10 08:23:12 +00:00
Owner

Summary

  • Add ChannelQueue class in src/runtime/channel-queue.ts that serializes tasks per channel via a Promise-chain FIFO queue
  • Update src/router.ts to wrap each routeMessage handler in channelQueue.enqueue() so same-channel messages run serially while different channels stay parallel
  • Map entries are cleaned up automatically after a channel's last task completes

Tests

  • tests/unit/channel-queue.test.ts: FIFO order, error recovery, map cleanup, channel parallelism (4 cases)
  • tests/integration/channel-queue-router.test.ts: mocked runAgent, 3 messages in same channel verified in order

All 51 tests pass, TypeScript compiles clean.

## Summary - Add `ChannelQueue` class in `src/runtime/channel-queue.ts` that serializes tasks per channel via a Promise-chain FIFO queue - Update `src/router.ts` to wrap each `routeMessage` handler in `channelQueue.enqueue()` so same-channel messages run serially while different channels stay parallel - Map entries are cleaned up automatically after a channel's last task completes ## Tests - `tests/unit/channel-queue.test.ts`: FIFO order, error recovery, map cleanup, channel parallelism (4 cases) - `tests/integration/channel-queue-router.test.ts`: mocked `runAgent`, 3 messages in same channel verified in order All 51 tests pass, TypeScript compiles clean.
dev added 1 commit 2026-04-09 15:49:17 +00:00
feat(DIS-103): ChannelQueue serializes messages per channel (FIFO)
Some checks failed
CI / build-and-test (ubuntu-latest) (pull_request) Has been cancelled
CI / build-and-test (windows-latest) (pull_request) Has been cancelled
CI / lint (pull_request) Has been cancelled
24bd34f886
Add ChannelQueue in src/runtime/channel-queue.ts.
Router enqueues each message so same-channel requests run serially.
Different channels remain parallel.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dev force-pushed phase-1/channel-queue from 24bd34f886 to 8fed430afc 2026-04-10 08:19:11 +00:00 Compare
dev merged commit fac6bbd371 into main 2026-04-10 08:23:12 +00:00
dev deleted branch phase-1/channel-queue 2026-04-10 08:24:20 +00:00
Sign in to join this conversation.
No description provided.