fix(telegram): split streaming preview per assistant block (#22613)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 26f35f4411
Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Reviewed-by: @obviyus
This commit is contained in:
Ayaan Zaidi
2026-02-21 18:05:23 +05:30
committed by GitHub
parent 36a0df423d
commit 8b1fe0d1e2
14 changed files with 277 additions and 19 deletions

View File

@@ -3,6 +3,7 @@ export type DraftStreamLoop = {
flush: () => Promise<void>;
stop: () => void;
resetPending: () => void;
resetThrottleWindow: () => void;
waitForInFlight: () => Promise<void>;
};
@@ -87,6 +88,13 @@ export function createDraftStreamLoop(params: {
resetPending: () => {
pendingText = "";
},
resetThrottleWindow: () => {
lastSentAt = 0;
if (timer) {
clearTimeout(timer);
timer = undefined;
}
},
waitForInFlight: async () => {
if (inFlightPromise) {
await inFlightPromise;