← Back to PRs

#19981: feat(matrix): enable block streaming

by alberthild open 2026-02-18 10:59 View on GitHub →
docs channel: matrix gateway size: XS
### Summary Enable block streaming for the Matrix channel. Messages are sent in blocks as the assistant generates them, reducing perceived latency for long replies. ### Changes - Set `blockStreaming: true` in Matrix channel capabilities - Add `blockStreamingCoalesceDefaults` (`minChars: 1500`, `idleMs: 1000`) matching Signal/Slack/Discord defaults - Update docs: `matrix.md`, `streaming.md`, `configuration-reference.md` ### How it works Block streaming sends completed text blocks as separate messages while the model is still generating. The coalescer merges small chunks (< 1500 chars) and flushes after 1s idle. No runtime code changes needed — the core block-streaming pipeline already supports any channel that declares the capability. Users enable it via: ```json5 { agents: { defaults: { blockStreamingDefault: "on" } } } ``` ### Testing - TypeScript: compiles clean (zero errors) - Unit tests: 28/28 matrix extension tests pass (no regression) - Live tested on Matrix (Synapse homeserver + Element client) - Staging gateway boot tested with config enabled ### Related - Continuation of block streaming work from #12709 (@emonty) - Docs reference: [Streaming and Chunking](/concepts/streaming) <!-- greptile_comment --> <h3>Greptile Summary</h3> Enables block streaming for the Matrix channel by declaring `blockStreaming: true` in capabilities and setting `blockStreamingCoalesceDefaults` (`minChars: 1500`, `idleMs: 1000`) to match Signal/Slack/Discord/Google Chat defaults. No runtime code changes were needed — the core block-streaming pipeline already supports any channel that declares these settings, and the Matrix message handler already uses `createReplyDispatcherWithTyping` + `dispatchReplyFromConfig` which integrate with block streaming automatically. - `extensions/matrix/src/channel.ts`: Added `blockStreaming: true` to capabilities and `streaming.blockStreamingCoalesceDefaults` config - `docs/channels/matrix.md`: Added block streaming to capabilities table, new "Streaming" section with global and per-channel config examples - `docs/concepts/streaming.md`: Added Matrix to the list of channels with 1500-char coalesce default - `docs/gateway/configuration-reference.md`: Added Matrix to the list of channels with 1500-char coalesce default <h3>Confidence Score: 5/5</h3> - This PR is safe to merge — it adds a declarative capability flag and coalesce defaults with no runtime code changes. - The change is minimal and purely declarative: two config properties added to the Matrix channel plugin matching the exact same pattern and values used by Signal, Slack, Discord, and Google Chat. The core block-streaming pipeline already handles channels that declare these settings. Documentation updates are consistent and accurate. All 28 Matrix extension tests pass per the PR description. - No files require special attention. <sub>Last reviewed commit: 6de6b5b</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs