fix(reply): dedupe combined direct block text · openclaw/openclaw@551664c
vincentkoc
·
2026-06-11
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -850,6 +850,28 @@ describe("buildReplyPayloads media filter integration", () => {
|
850 | 850 | expectFields(replyPayloads[0], { text: "new final response" }); |
851 | 851 | }); |
852 | 852 | |
| 853 | +it("keeps only final media after multiple direct text blocks", async () => { |
| 854 | +const { createBlockReplyContentKey } = await import("./block-reply-pipeline.js"); |
| 855 | +const directlySentBlockKeys = new Set<string>([ |
| 856 | +createBlockReplyContentKey({ text: "Preview" }), |
| 857 | +createBlockReplyContentKey({ text: " below" }), |
| 858 | +]); |
| 859 | + |
| 860 | +const { replyPayloads } = await buildReplyPayloads({ |
| 861 | + ...baseParams, |
| 862 | +blockStreamingEnabled: true, |
| 863 | + directlySentBlockKeys, |
| 864 | +payloads: [{ text: "Preview below\n\nMEDIA:/tmp/generated.png" }], |
| 865 | +}); |
| 866 | + |
| 867 | +expect(replyPayloads).toHaveLength(1); |
| 868 | +expectFields(replyPayloads[0], { |
| 869 | +text: undefined, |
| 870 | +mediaUrl: "/tmp/generated.png", |
| 871 | +mediaUrls: ["/tmp/generated.png"], |
| 872 | +}); |
| 873 | +}); |
| 874 | + |
853 | 875 | it("does not suppress same-target replies when accountId differs", async () => { |
854 | 876 | const { replyPayloads } = await buildReplyPayloads({ |
855 | 877 | ...baseParams, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。