← Back to PRs

#19798: fix(reply-dispatcher): add parallel blockChain for real-time block streaming

by norci open 2026-02-18 05:35 View on GitHub →
size: XS
## Summary This PR adds parallel blockChain support to enable real-time LLM output streaming in Matrix channels while tools are executing. ## Problem Previously, block replies (LLM streaming output) were queued behind tool results in a single serial chain. This meant users in Matrix channels couldn't see LLM-generated text until all tool execution completed. ## Solution Add a separate blockChain in reply-dispatcher.ts that allows block replies to be delivered in parallel with tool execution, while preserving the serial ordering for tool results and final replies. ## Changes | File | Change | |------|--------| | src/auto-reply/reply/reply-dispatcher.ts | Add parallel blockChain for block replies; update waitForIdle() to wait for both chains | ## How It Works - Block replies now have their own delivery chain that runs in parallel with the main chain - Tool results and final replies still use the main serial chain (preserves ordering) - waitForIdle() now waits for both chains to complete - Block streaming behavior remains config-controlled (no default behavior change) ## Testing - [x] Code reviewed and tested ## AI-Assisted

Most Similar PRs