fix: enable block streaming for Telegram when streamMode is 'block'
- Fix disableBlockStreaming logic in telegram/bot.ts to properly enable block streaming when telegram.streamMode is 'block' regardless of blockStreamingDefault setting - Set minChars default to 1 for Telegram block mode so chunks send immediately on newlines/sentences instead of waiting for 800 chars - Skip coalescing for Telegram block mode when not explicitly configured to reduce chunk batching delays - Fix newline preference to wait for actual newlines instead of breaking on any whitespace when buffer is under maxChars Fixes issue where all Telegram messages were batched into one message at the end instead of streaming as separate messages during generation.
This commit is contained in:
@@ -221,6 +221,10 @@ export class EmbeddedBlockChunker {
|
||||
if (sentenceIdx >= minChars) return { index: sentenceIdx };
|
||||
}
|
||||
|
||||
if (preference === "newline" && buffer.length < maxChars) {
|
||||
return { index: -1 };
|
||||
}
|
||||
|
||||
for (let i = window.length - 1; i >= minChars; i--) {
|
||||
if (/\s/.test(window[i]) && isSafeFenceBreak(fenceSpans, i)) {
|
||||
return { index: i };
|
||||
|
||||
Reference in New Issue
Block a user