惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

云风的 BLOG
云风的 BLOG
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
IT之家
IT之家
Recent Announcements
Recent Announcements
B
Blog
D
Docker
V
V2EX
GbyAI
GbyAI
L
LangChain Blog
博客园 - Franky
U
Unit 42
T
The Blog of Author Tim Ferriss
A
About on SuperTechFans
博客园 - 【当耐特】
Google DeepMind News
Google DeepMind News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Vercel News
Vercel News
博客园_首页
D
DataBreaches.Net
人人都是产品经理
人人都是产品经理
Y
Y Combinator Blog
量子位
Blog — PlanetScale
Blog — PlanetScale
罗磊的独立博客

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(reply): preserve unsent text-only finals after block ...
liuhao1024 · 2026-06-16 · via Recent Commits to openclaw:main

@@ -905,7 +905,7 @@ describe("buildReplyPayloads media filter integration", () => {

905905

expect(replyPayloads).toHaveLength(0);

906906

});

907907908-

it("drops all final payloads when block pipeline streamed successfully", async () => {

908+

it("preserves unsent text-only final payloads after block pipeline streamed partial content", async () => {

909909

const pipeline: Parameters<typeof buildReplyPayloads>[0]["blockReplyPipeline"] = {

910910

didStream: () => true,

911911

isAborted: () => false,

@@ -916,8 +916,36 @@ describe("buildReplyPayloads media filter integration", () => {

916916

hasBuffered: () => false,

917917

getSentMediaUrls: () => [],

918918

};

919-

// shouldDropFinalPayloads short-circuits to [] when the pipeline streamed

920-

// without aborting, so hasSentPayload is never reached.

919+

// The pipeline streamed some partial content, but the final text payload was

920+

// never sent (hasSentPayload returns false). The old bug dropped all text-only

921+

// finals unconditionally; the fix preserves unsent finals.

922+

const { replyPayloads } = await buildReplyPayloads({

923+

...baseParams,

924+

blockStreamingEnabled: true,

925+

blockReplyPipeline: pipeline,

926+

replyToMode: "all",

927+

payloads: [{ text: "response", replyToId: "post-123" }],

928+

});

929+930+

expect(replyPayloads).toHaveLength(1);

931+

expect(replyPayloads[0]?.text).toBe("response");

932+

});

933+934+

it("drops already-sent text-only final payloads after block pipeline streamed the exact same text", async () => {

935+

const pipeline: Parameters<typeof buildReplyPayloads>[0]["blockReplyPipeline"] = {

936+

didStream: () => true,

937+

isAborted: () => false,

938+

hasSentPayload: () => true,

939+

hasSentExactPayload: (payload) =>

940+

payload.text === "response" && !payload.mediaUrl && !payload.mediaUrls,

941+

enqueue: () => {},

942+

flush: async () => {},

943+

stop: () => {},

944+

hasBuffered: () => false,

945+

getSentMediaUrls: () => [],

946+

};

947+

// The final text-only payload matches what the pipeline already sent,

948+

// so it should be dropped.

921949

const { replyPayloads } = await buildReplyPayloads({

922950

...baseParams,

923951

blockStreamingEnabled: true,

@@ -929,6 +957,60 @@ describe("buildReplyPayloads media filter integration", () => {

929957

expect(replyPayloads).toHaveLength(0);

930958

});

931959960+

it("drops a text-only final with an empty envelope assembled from multiple streamed blocks", async () => {

961+

const pipeline: Parameters<typeof buildReplyPayloads>[0]["blockReplyPipeline"] = {

962+

didStream: () => true,

963+

isAborted: () => false,

964+

hasSentPayload: () => true,

965+

hasSentExactPayload: () => false,

966+

enqueue: () => {},

967+

flush: async () => {},

968+

stop: () => {},

969+

hasBuffered: () => false,

970+

getSentMediaUrls: () => [],

971+

};

972+973+

const { replyPayloads } = await buildReplyPayloads({

974+

...baseParams,

975+

blockStreamingEnabled: true,

976+

blockReplyPipeline: pipeline,

977+

payloads: [{ text: "first block second block", channelData: {} }],

978+

});

979+980+

expect(replyPayloads).toHaveLength(0);

981+

});

982+983+

it("preserves final rich content when only its text was streamed", async () => {

984+

const pipeline: Parameters<typeof buildReplyPayloads>[0]["blockReplyPipeline"] = {

985+

didStream: () => true,

986+

isAborted: () => false,

987+

hasSentPayload: () => true,

988+

hasSentExactPayload: () => false,

989+

enqueue: () => {},

990+

flush: async () => {},

991+

stop: () => {},

992+

hasBuffered: () => false,

993+

getSentMediaUrls: () => [],

994+

};

995+

const presentation = {

996+

blocks: [{ type: "buttons" as const, buttons: [{ label: "Open", value: "open" }] }],

997+

};

998+999+

const { replyPayloads } = await buildReplyPayloads({

1000+

...baseParams,

1001+

blockStreamingEnabled: true,

1002+

blockReplyPipeline: pipeline,

1003+

payloads: [{ text: "response", presentation }],

1004+

});

1005+1006+

expect(replyPayloads).toEqual([

1007+

expect.objectContaining({

1008+

text: "response",

1009+

presentation,

1010+

}),

1011+

]);

1012+

});

1013+9321014

it("keeps unsent final media after block pipeline streamed the text", async () => {

9331015

const pipeline: Parameters<typeof buildReplyPayloads>[0]["blockReplyPipeline"] = {

9341016

didStream: () => true,