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

推荐订阅源

Jina AI
Jina AI
S
SegmentFault 最新的问题
D
DataBreaches.Net
H
Help Net Security
有赞技术团队
有赞技术团队
M
MIT News - Artificial intelligence
Martin Fowler
Martin Fowler
IT之家
IT之家
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
腾讯CDC
罗磊的独立博客
Y
Y Combinator Blog
阮一峰的网络日志
阮一峰的网络日志
云风的 BLOG
云风的 BLOG
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
WordPress大学
WordPress大学
Microsoft Security Blog
Microsoft Security Blog
J
Java Code Geeks
Vercel News
Vercel News
Hugging Face - Blog
Hugging Face - Blog
aimingoo的专栏
aimingoo的专栏
Stack Overflow Blog
Stack Overflow Blog
Recent Announcements
Recent Announcements
博客园 - 三生石上(FineUI控件)

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
test: tighten media echo transcript assertions · openclaw...
steipete · 2026-05-09 · via Recent Commits to openclaw:main

@@ -25,6 +25,8 @@ vi.mock("../utils/message-channel.js", () => ({

25252626

import { DEFAULT_ECHO_TRANSCRIPT_FORMAT, sendTranscriptEcho } from "./echo-transcript.js";

272728+

const EMPTY_CONFIG = {} as OpenClawConfig;

29+2830

function createCtx(overrides?: Partial<MsgContext>): MsgContext {

2931

return {

3032

Provider: "voicechat",

@@ -47,44 +49,47 @@ describe("sendTranscriptEcho", () => {

4749

it("sends the default formatted transcript to the resolved origin", async () => {

4850

await sendTranscriptEcho({

4951

ctx: createCtx(),

50-

cfg: {} as OpenClawConfig,

52+

cfg: EMPTY_CONFIG,

5153

transcript: "hello world",

5254

});

53555456

expect(mockDeliverOutboundPayloads).toHaveBeenCalledOnce();

55-

expect(mockDeliverOutboundPayloads).toHaveBeenCalledWith(

56-

expect.objectContaining({

57-

cfg: {},

58-

channel: "voicechat",

59-

to: "+10000000001",

60-

accountId: "acc1",

61-

threadId: undefined,

62-

payloads: [{ text: DEFAULT_ECHO_TRANSCRIPT_FORMAT.replace("{transcript}", "hello world") }],

63-

bestEffort: true,

64-

durability: "best_effort",

65-

}),

66-

);

57+

expect(mockDeliverOutboundPayloads).toHaveBeenCalledWith({

58+

cfg: EMPTY_CONFIG,

59+

channel: "voicechat",

60+

to: "+10000000001",

61+

accountId: "acc1",

62+

threadId: undefined,

63+

payloads: [{ text: DEFAULT_ECHO_TRANSCRIPT_FORMAT.replace("{transcript}", "hello world") }],

64+

bestEffort: true,

65+

durability: "best_effort",

66+

});

6767

});

68686969

it("uses a custom format when provided", async () => {

7070

await sendTranscriptEcho({

7171

ctx: createCtx(),

72-

cfg: {} as OpenClawConfig,

72+

cfg: EMPTY_CONFIG,

7373

transcript: "custom message",

7474

format: "🎙️ Heard: {transcript}",

7575

});

767677-

expect(mockDeliverOutboundPayloads).toHaveBeenCalledWith(

78-

expect.objectContaining({

79-

payloads: [{ text: "🎙️ Heard: custom message" }],

80-

}),

81-

);

77+

expect(mockDeliverOutboundPayloads).toHaveBeenCalledWith({

78+

cfg: EMPTY_CONFIG,

79+

channel: "voicechat",

80+

to: "+10000000001",

81+

accountId: "acc1",

82+

threadId: undefined,

83+

payloads: [{ text: "🎙️ Heard: custom message" }],

84+

bestEffort: true,

85+

durability: "best_effort",

86+

});

8287

});

83888489

it("skips non-deliverable channels", async () => {

8590

await sendTranscriptEcho({

8691

ctx: createCtx({ Provider: "internal-system", From: "some-source" }),

87-

cfg: {} as OpenClawConfig,

92+

cfg: EMPTY_CONFIG,

8893

transcript: "hello world",

8994

});

9095

@@ -94,7 +99,7 @@ describe("sendTranscriptEcho", () => {

9499

it("skips when ctx has no resolved destination", async () => {

95100

await sendTranscriptEcho({

96101

ctx: createCtx({ From: undefined, OriginatingTo: undefined }),

97-

cfg: {} as OpenClawConfig,

102+

cfg: EMPTY_CONFIG,

98103

transcript: "hello world",

99104

});

100105

@@ -104,15 +109,20 @@ describe("sendTranscriptEcho", () => {

104109

it("prefers OriginatingTo when From is absent", async () => {

105110

await sendTranscriptEcho({

106111

ctx: createCtx({ From: undefined, OriginatingTo: "+19999999999" }),

107-

cfg: {} as OpenClawConfig,

112+

cfg: EMPTY_CONFIG,

108113

transcript: "hello world",

109114

});

110115111-

expect(mockDeliverOutboundPayloads).toHaveBeenCalledWith(

112-

expect.objectContaining({

113-

to: "+19999999999",

114-

}),

115-

);

116+

expect(mockDeliverOutboundPayloads).toHaveBeenCalledWith({

117+

cfg: EMPTY_CONFIG,

118+

channel: "voicechat",

119+

to: "+19999999999",

120+

accountId: "acc1",

121+

threadId: undefined,

122+

payloads: [{ text: DEFAULT_ECHO_TRANSCRIPT_FORMAT.replace("{transcript}", "hello world") }],

123+

bestEffort: true,

124+

durability: "best_effort",

125+

});

116126

});

117127118128

it("forwards Telegram account and thread metadata to outbound delivery", async () => {

@@ -124,21 +134,22 @@ describe("sendTranscriptEcho", () => {

124134

AccountId: "primary",

125135

MessageThreadId: 77,

126136

}),

127-

cfg: {} as OpenClawConfig,

137+

cfg: EMPTY_CONFIG,

128138

transcript: "threaded voice note",

129139

});

130140131-

expect(mockDeliverOutboundPayloads).toHaveBeenCalledWith(

132-

expect.objectContaining({

133-

channel: "telegram",

134-

to: "telegram:42",

135-

accountId: "primary",

136-

threadId: 77,

137-

payloads: [

138-

{ text: DEFAULT_ECHO_TRANSCRIPT_FORMAT.replace("{transcript}", "threaded voice note") },

139-

],

140-

}),

141-

);

141+

expect(mockDeliverOutboundPayloads).toHaveBeenCalledWith({

142+

cfg: EMPTY_CONFIG,

143+

channel: "telegram",

144+

to: "telegram:42",

145+

accountId: "primary",

146+

threadId: 77,

147+

payloads: [

148+

{ text: DEFAULT_ECHO_TRANSCRIPT_FORMAT.replace("{transcript}", "threaded voice note") },

149+

],

150+

bestEffort: true,

151+

durability: "best_effort",

152+

});

142153

});

143154144155

it("swallows delivery failures", async () => {

@@ -147,7 +158,7 @@ describe("sendTranscriptEcho", () => {

147158

await expect(

148159

sendTranscriptEcho({

149160

ctx: createCtx(),

150-

cfg: {} as OpenClawConfig,

161+

cfg: EMPTY_CONFIG,

151162

transcript: "hello world",

152163

}),

153164

).resolves.toBeUndefined();