fix(telegram): keep bot reply answers anchored to current message (#9… · openclaw/openclaw@5cafe4b
moeedahmed
·
2026-06-23
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1284,6 +1284,39 @@ describe("dispatchTelegramMessage draft streaming", () => {
|
1284 | 1284 | expectRecordFields((delivery.replies as Array<unknown>)[0], { replyToId: "9001" }); |
1285 | 1285 | }); |
1286 | 1286 | |
| 1287 | +it("keeps bot-reply answers anchored to the current user message", async () => { |
| 1288 | +dispatchReplyWithBufferedBlockDispatcher.mockImplementation(async ({ dispatcherOptions }) => { |
| 1289 | +await dispatcherOptions.deliver({ text: "Hello", replyToId: "1001" }, { kind: "final" }); |
| 1290 | +return { queuedFinal: true }; |
| 1291 | +}); |
| 1292 | +deliverReplies.mockResolvedValue({ delivered: true }); |
| 1293 | + |
| 1294 | +await dispatchWithContext({ |
| 1295 | +context: createContext({ |
| 1296 | +msg: { |
| 1297 | +message_id: 1001, |
| 1298 | +reply_to_message: { |
| 1299 | +message_id: 9001, |
| 1300 | +from: { is_bot: true }, |
| 1301 | +}, |
| 1302 | +} as unknown as TelegramMessageContext["msg"], |
| 1303 | +ctxPayload: { |
| 1304 | +MessageSid: "1001", |
| 1305 | +ReplyToId: "9001", |
| 1306 | +ReplyToBody: "quoted bot reply", |
| 1307 | +ReplyToQuoteText: " quoted bot reply\n", |
| 1308 | +ReplyToIsQuote: true, |
| 1309 | +} as unknown as TelegramMessageContext["ctxPayload"], |
| 1310 | +}), |
| 1311 | +}); |
| 1312 | + |
| 1313 | +const delivery = expectDeliverRepliesParams({ |
| 1314 | +replyQuoteMessageId: 9001, |
| 1315 | +replyQuoteText: " quoted bot reply\n", |
| 1316 | +}); |
| 1317 | +expectRecordFields((delivery.replies as Array<unknown>)[0], { replyToId: "1001" }); |
| 1318 | +}); |
| 1319 | + |
1287 | 1320 | it("keeps answer draft stream for current message replies with native quote candidates", async () => { |
1288 | 1321 | const draftStream = createDraftStream(); |
1289 | 1322 | createTelegramDraftStream.mockReturnValue(draftStream); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。