mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 09:11:26 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user