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

推荐订阅源

IT之家
IT之家
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
A
About on SuperTechFans
博客园 - 聂微东
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
B
Blog RSS Feed
U
Unit 42
Stack Overflow Blog
Stack Overflow Blog
Recent Announcements
Recent Announcements
雷峰网
雷峰网
罗磊的独立博客
Microsoft Security Blog
Microsoft Security Blog
Hugging Face - Blog
Hugging Face - Blog
L
LangChain Blog
人人都是产品经理
人人都是产品经理
The GitHub Blog
The GitHub Blog
F
Fortinet All Blogs
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
H
Help Net Security
P
Proofpoint News Feed
The Cloudflare Blog
D
Docker
大猫的无限游戏
大猫的无限游戏

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(feishu): coalesce streaming card final delivery · ope...
vincentkoc · 2026-04-25 · via Recent Commits to openclaw:main

@@ -296,6 +296,7 @@ describe("createFeishuReplyDispatcher streaming behavior", () => {

296296

rootId: "om_root_topic",

297297

});

298298

await options.deliver({ text: "```ts\nconst x = 1\n```" }, { kind: "final" });

299+

await options.onIdle?.();

299300300301

expect(streamingInstances).toHaveLength(1);

301302

expect(streamingInstances[0].start).toHaveBeenCalledTimes(1);

@@ -330,20 +331,17 @@ describe("createFeishuReplyDispatcher streaming behavior", () => {

330331

});

331332

});

332333333-

it("delivers distinct final payloads after streaming close", async () => {

334+

it("coalesces distinct final payloads into one streaming card until idle", async () => {

334335

const { options } = createDispatcherHarness({

335336

runtime: createRuntimeLogger(),

336337

});

337338

await options.deliver({ text: "```md\n完整回复第一段\n```" }, { kind: "final" });

338339

await options.deliver({ text: "```md\n完整回复第一段 + 第二段\n```" }, { kind: "final" });

340+

await options.onIdle?.();

339341340-

expect(streamingInstances).toHaveLength(2);

342+

expect(streamingInstances).toHaveLength(1);

341343

expect(streamingInstances[0].close).toHaveBeenCalledTimes(1);

342-

expect(streamingInstances[0].close).toHaveBeenCalledWith("```md\n完整回复第一段\n```", {

343-

note: "Agent: agent",

344-

});

345-

expect(streamingInstances[1].close).toHaveBeenCalledTimes(1);

346-

expect(streamingInstances[1].close).toHaveBeenCalledWith(

344+

expect(streamingInstances[0].close).toHaveBeenCalledWith(

347345

"```md\n完整回复第一段 + 第二段\n```",

348346

{

349347

note: "Agent: agent",

@@ -358,6 +356,7 @@ describe("createFeishuReplyDispatcher streaming behavior", () => {

358356

runtime: createRuntimeLogger(),

359357

});

360358

await options.deliver({ text: "```md\n同一条回复\n```" }, { kind: "final" });

359+

await options.onIdle?.();

361360

await options.deliver({ text: "```md\n同一条回复\n```" }, { kind: "final" });

362361363362

expect(streamingInstances).toHaveLength(1);

@@ -370,6 +369,17 @@ describe("createFeishuReplyDispatcher streaming behavior", () => {

370369

});

371370372371

it("skips final text already closed by idle streaming", async () => {

372+

resolveFeishuAccountMock.mockReturnValue({

373+

accountId: "main",

374+

appId: "app_id",

375+

appSecret: "app_secret",

376+

domain: "feishu",

377+

config: {

378+

renderMode: "card",

379+

streaming: true,

380+

},

381+

});

382+373383

const { result, options } = createDispatcherHarness({

374384

runtime: createRuntimeLogger(),

375385

});

@@ -454,6 +464,33 @@ describe("createFeishuReplyDispatcher streaming behavior", () => {

454464

});

455465

});

456466467+

it("skips block payloads that exactly repeat the latest partial snapshot", async () => {

468+

resolveFeishuAccountMock.mockReturnValue({

469+

accountId: "main",

470+

appId: "app_id",

471+

appSecret: "app_secret",

472+

domain: "feishu",

473+

config: {

474+

renderMode: "card",

475+

streaming: true,

476+

},

477+

});

478+479+

const { result, options } = createDispatcherHarness({

480+

runtime: createRuntimeLogger(),

481+

});

482+

await options.onReplyStart?.();

483+

result.replyOptions.onPartialReply?.({ text: "```md\npartial\n```" });

484+

await options.deliver({ text: "```md\npartial\n```" }, { kind: "block" });

485+

await options.onIdle?.();

486+487+

expect(streamingInstances).toHaveLength(1);

488+

expect(streamingInstances[0].close).toHaveBeenCalledTimes(1);

489+

expect(streamingInstances[0].close).toHaveBeenCalledWith("```md\npartial\n```", {

490+

note: "Agent: agent",

491+

});

492+

});

493+457494

it("sends media-only payloads as attachments", async () => {

458495

const { options } = createDispatcherHarness();

459496

await options.deliver({ mediaUrl: "https://example.com/a.png" }, { kind: "final" });

@@ -508,6 +545,7 @@ describe("createFeishuReplyDispatcher streaming behavior", () => {

508545

{ text: "```ts\nconst x = 1\n```", mediaUrls: ["https://example.com/a.png"] },

509546

{ kind: "final" },

510547

);

548+

await options.onIdle?.();

511549512550

expect(streamingInstances).toHaveLength(1);

513551

expect(streamingInstances[0].start).toHaveBeenCalledTimes(1);

@@ -576,6 +614,7 @@ describe("createFeishuReplyDispatcher streaming behavior", () => {

576614

result.replyOptions.onPartialReply?.({ text: "answer part" });

577615

result.replyOptions.onReasoningEnd?.();

578616

await options.deliver({ text: "answer part final" }, { kind: "final" });

617+

await options.onIdle?.();

579618580619

expect(streamingInstances).toHaveLength(1);

581620

const updateCalls = streamingInstances[0].update.mock.calls.map((c: unknown[]) =>

@@ -667,6 +706,7 @@ describe("createFeishuReplyDispatcher streaming behavior", () => {

667706

result.replyOptions.onReasoningStream?.({ text: "" });

668707

result.replyOptions.onPartialReply?.({ text: "```ts\ncode\n```" });

669708

await options.deliver({ text: "```ts\ncode\n```" }, { kind: "final" });

709+

await options.onIdle?.();

670710671711

expect(streamingInstances).toHaveLength(1);

672712

const closeArg = streamingInstances[0].close.mock.calls[0][0] as string;

@@ -684,6 +724,7 @@ describe("createFeishuReplyDispatcher streaming behavior", () => {

684724

result.replyOptions.onReasoningStream?.({ text: "Reasoning:\n_thought_" });

685725

result.replyOptions.onReasoningEnd?.();

686726

await options.deliver({ text: "```ts\nfinal answer\n```" }, { kind: "final" });

727+

await options.onIdle?.();

687728688729

expect(streamingInstances).toHaveLength(1);

689730

expect(streamingInstances[0].close).toHaveBeenCalledTimes(1);

@@ -798,6 +839,7 @@ describe("createFeishuReplyDispatcher streaming behavior", () => {

798839

// or transient Feishu failures recover without a process restart.

799840

nowSpy.mockReturnValue(62_000);

800841

await options.deliver({ text: "```ts\nconst z = 3\n```" }, { kind: "final" });

842+

await options.onIdle?.();

801843802844

expect(streamingInstances).toHaveLength(2);

803845

expect(streamingInstances[1].start).toHaveBeenCalled();