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

推荐订阅源

C
Check Point Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
L
LangChain Blog
云风的 BLOG
云风的 BLOG
M
MIT News - Artificial intelligence
A
About on SuperTechFans
J
Java Code Geeks
量子位
博客园 - 三生石上(FineUI控件)
博客园 - Franky
博客园_首页
H
Hackread – Cybersecurity News, Data Breaches, AI and More
IT之家
IT之家
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Apple Machine Learning Research
Apple Machine Learning Research
Engineering at Meta
Engineering at Meta
雷峰网
雷峰网
D
DataBreaches.Net
人人都是产品经理
人人都是产品经理
Martin Fowler
Martin Fowler
有赞技术团队
有赞技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻

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): avoid duplicate voice reply text · openclaw/...
vincentkoc · 2026-05-03 · via Recent Commits to openclaw:main

@@ -12,9 +12,14 @@ const sendMarkdownCardFeishuMock = vi.hoisted(() => vi.fn());

1212

const sendStructuredCardFeishuMock = vi.hoisted(() => vi.fn());

1313

const deliverCommentThreadTextMock = vi.hoisted(() => vi.fn());

1414

const cleanupAmbientCommentTypingReactionMock = vi.hoisted(() => vi.fn(async () => false));

15+

const shouldSuppressFeishuTextForVoiceMediaMock = vi.hoisted(

16+

() => (params: { mediaUrl?: string; audioAsVoice?: boolean }) =>

17+

params.audioAsVoice === true || /\.(?:ogg|opus)(?:[?#]|$)/i.test(params.mediaUrl ?? ""),

18+

);

15191620

vi.mock("./media.js", () => ({

1721

sendMediaFeishu: sendMediaFeishuMock,

22+

shouldSuppressFeishuTextForVoiceMedia: shouldSuppressFeishuTextForVoiceMediaMock,

1823

}));

19242025

vi.mock("./send.js", () => ({

@@ -406,13 +411,13 @@ describe("feishuOutbound.sendPayload native cards", () => {

406411

await feishuOutbound.sendPayload?.({

407412

cfg: emptyConfig,

408413

to: "chat_1",

409-

text: "Choose <at id=\"ou_1\">",

414+

text: 'Choose <at id="ou_1">',

410415

accountId: "main",

411416

payload: {

412-

text: "Choose <at id=\"ou_1\">",

417+

text: 'Choose <at id="ou_1">',

413418

presentation: {

414419

blocks: [

415-

{ type: "context", text: "</font><at id=\"ou_2\">Injected</at>" },

420+

{ type: "context", text: '</font><at id="ou_2">Injected</at>' },

416421

{

417422

type: "buttons",

418423

buttons: [

@@ -428,10 +433,11 @@ describe("feishuOutbound.sendPayload native cards", () => {

428433

const card = sendCardFeishuMock.mock.calls[0][0].card;

429434

expect(card.body.elements).toEqual(

430435

expect.arrayContaining([

431-

{ tag: "markdown", content: "Choose &lt;at id=\"ou_1\"&gt;" },

436+

{ tag: "markdown", content: 'Choose &lt;at id="ou_1"&gt;' },

432437

{

433438

tag: "markdown",

434-

content: "<font color='grey'>&lt;/font&gt;&lt;at id=\"ou_2\"&gt;Injected&lt;/at&gt;</font>",

439+

content:

440+

"<font color='grey'>&lt;/font&gt;&lt;at id=\"ou_2\"&gt;Injected&lt;/at&gt;</font>",

435441

},

436442

{

437443

tag: "action",

@@ -466,7 +472,7 @@ describe("feishuOutbound.sendPayload native cards", () => {

466472

body: {

467473

elements: [

468474

{ tag: "img", img_key: "image-secret" },

469-

{ tag: "markdown", content: "<at id=\"ou_1\">ping</at>" },

475+

{ tag: "markdown", content: '<at id="ou_1">ping</at>' },

470476

{

471477

tag: "action",

472478

actions: [

@@ -493,7 +499,7 @@ describe("feishuOutbound.sendPayload native cards", () => {

493499

const card = sendCardFeishuMock.mock.calls[0][0].card;

494500

expect(card.header.template).toBe("blue");

495501

expect(card.body.elements).toEqual([

496-

{ tag: "markdown", content: "&lt;at id=\"ou_1\"&gt;ping&lt;/at&gt;" },

502+

{ tag: "markdown", content: '&lt;at id="ou_1"&gt;ping&lt;/at&gt;' },

497503

{

498504

tag: "action",

499505

actions: [

@@ -855,6 +861,83 @@ describe("feishuOutbound.sendMedia replyToId forwarding", () => {

855861

);

856862

});

857863864+

it("suppresses duplicate text when sending voice media", async () => {

865+

await feishuOutbound.sendMedia?.({

866+

cfg: emptyConfig,

867+

to: "chat_1",

868+

text: "spoken reply",

869+

mediaUrl: "https://example.com/reply.mp3",

870+

audioAsVoice: true,

871+

accountId: "main",

872+

});

873+874+

expect(sendMessageFeishuMock).not.toHaveBeenCalled();

875+

expect(sendMediaFeishuMock).toHaveBeenCalledWith(

876+

expect.objectContaining({

877+

mediaUrl: "https://example.com/reply.mp3",

878+

audioAsVoice: true,

879+

}),

880+

);

881+

});

882+883+

it("suppresses duplicate text for native voice media without audioAsVoice", async () => {

884+

await feishuOutbound.sendMedia?.({

885+

cfg: emptyConfig,

886+

to: "chat_1",

887+

text: "spoken reply",

888+

mediaUrl: "https://example.com/reply.ogg?download=1",

889+

accountId: "main",

890+

});

891+892+

expect(sendMessageFeishuMock).not.toHaveBeenCalled();

893+

expect(sendMediaFeishuMock).toHaveBeenCalledWith(

894+

expect.objectContaining({

895+

mediaUrl: "https://example.com/reply.ogg?download=1",

896+

}),

897+

);

898+

});

899+900+

it("keeps captions for regular audio file attachments", async () => {

901+

await feishuOutbound.sendMedia?.({

902+

cfg: emptyConfig,

903+

to: "chat_1",

904+

text: "caption text",

905+

mediaUrl: "https://example.com/song.mp3",

906+

accountId: "main",

907+

});

908+909+

expect(sendMessageFeishuMock).toHaveBeenCalledWith(

910+

expect.objectContaining({

911+

text: "caption text",

912+

}),

913+

);

914+

expect(sendMediaFeishuMock).toHaveBeenCalledWith(

915+

expect.objectContaining({

916+

mediaUrl: "https://example.com/song.mp3",

917+

}),

918+

);

919+

});

920+921+

it("keeps skipped voice text in the upload failure fallback", async () => {

922+

sendMediaFeishuMock.mockRejectedValueOnce(new Error("upload failed"));

923+924+

await feishuOutbound.sendMedia?.({

925+

cfg: emptyConfig,

926+

to: "chat_1",

927+

text: "spoken reply",

928+

mediaUrl: "https://example.com/reply.mp3",

929+

audioAsVoice: true,

930+

accountId: "main",

931+

});

932+933+

expect(sendMessageFeishuMock).toHaveBeenCalledTimes(1);

934+

expect(sendMessageFeishuMock).toHaveBeenCalledWith(

935+

expect.objectContaining({

936+

text: "spoken reply\n\n📎 https://example.com/reply.mp3",

937+

}),

938+

);

939+

});

940+858941

it("forwards replyToId to text caption send", async () => {

859942

await feishuOutbound.sendMedia?.({

860943

cfg: emptyConfig,