mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 16:30:57 +00:00
fix(telegram): stream plain reply drafts
This commit is contained in:
@@ -479,7 +479,9 @@ describe("dispatchTelegramMessage draft streaming", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("passes native quote candidates for current message replies", async () => {
|
||||
it("keeps answer draft preview for current message replies with native quote candidates", async () => {
|
||||
const draftStream = createDraftStream();
|
||||
createTelegramDraftStream.mockReturnValue(draftStream);
|
||||
dispatchReplyWithBufferedBlockDispatcher.mockImplementation(async ({ dispatcherOptions }) => {
|
||||
await dispatcherOptions.deliver({ text: "Hello", replyToId: "1001" }, { kind: "final" });
|
||||
return { queuedFinal: true };
|
||||
@@ -499,7 +501,11 @@ describe("dispatchTelegramMessage draft streaming", () => {
|
||||
}),
|
||||
});
|
||||
|
||||
expect(createTelegramDraftStream).not.toHaveBeenCalled();
|
||||
expect(createTelegramDraftStream).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
replyToMessageId: 1001,
|
||||
}),
|
||||
);
|
||||
expect(deliverReplies).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
replies: [expect.objectContaining({ replyToId: "1001" })],
|
||||
|
||||
@@ -396,11 +396,10 @@ export const dispatchTelegramMessage = async ({
|
||||
);
|
||||
}
|
||||
}
|
||||
const hasNativeQuoteReply =
|
||||
replyToMode !== "off" && Object.keys(replyQuoteByMessageId).length > 0;
|
||||
const hasTelegramQuoteReply = replyToMode !== "off" && replyQuoteText != null;
|
||||
const canStreamAnswerDraft =
|
||||
previewStreamingEnabled &&
|
||||
!hasNativeQuoteReply &&
|
||||
!hasTelegramQuoteReply &&
|
||||
!accountBlockStreamingEnabled &&
|
||||
!forceBlockStreamingForReasoning;
|
||||
const canStreamReasoningDraft = streamReasoningDraft;
|
||||
|
||||
Reference in New Issue
Block a user