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

推荐订阅源

爱范儿
爱范儿
大猫的无限游戏
大猫的无限游戏
J
Java Code Geeks
MongoDB | Blog
MongoDB | Blog
Martin Fowler
Martin Fowler
GbyAI
GbyAI
Microsoft Azure Blog
Microsoft Azure Blog
Recent Announcements
Recent Announcements
F
Fortinet All Blogs
B
Blog
U
Unit 42
B
Blog RSS Feed
D
DataBreaches.Net
Google DeepMind News
Google DeepMind News
人人都是产品经理
人人都是产品经理
腾讯CDC
量子位
酷 壳 – CoolShell
酷 壳 – CoolShell
V
Visual Studio Blog
博客园 - 聂微东
MyScale Blog
MyScale Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 三生石上(FineUI控件)
Engineering at Meta
Engineering at Meta

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 discord voice message assertions · openclaw...
shakkernerd · 2026-05-11 · via Recent Commits to openclaw:main

@@ -62,6 +62,14 @@ describe("ensureOggOpus", () => {

6262

expect(stagedBase.endsWith(`-${path.basename(finalPath)}.part`)).toBe(true);

6363

}

646465+

function readSingleCommandArgs(mock: typeof runFfprobeMock | typeof runFfmpegMock): string[] {

66+

const args = mock.mock.calls[0]?.[0];

67+

if (!Array.isArray(args) || !args.every((arg): arg is string => typeof arg === "string")) {

68+

throw new Error("missing command args");

69+

}

70+

return args;

71+

}

72+6573

it("rejects URL/protocol input paths", async () => {

6674

await expect(ensureOggOpus("https://example.com/audio.ogg")).rejects.toThrow(

6775

/local file path/i,

@@ -76,9 +84,18 @@ describe("ensureOggOpus", () => {

7684

const result = await ensureOggOpus("/tmp/input.ogg");

77857886

expect(result).toEqual({ path: "/tmp/input.ogg", cleanup: false });

79-

expect(runFfprobeMock).toHaveBeenCalledWith(

80-

expect.arrayContaining(["-show_entries", "stream=codec_name,sample_rate", "/tmp/input.ogg"]),

81-

);

87+

expect(runFfprobeMock).toHaveBeenCalledTimes(1);

88+

expect(readSingleCommandArgs(runFfprobeMock)).toEqual([

89+

"-v",

90+

"error",

91+

"-select_streams",

92+

"a:0",

93+

"-show_entries",

94+

"stream=codec_name,sample_rate",

95+

"-of",

96+

"csv=p=0",

97+

"/tmp/input.ogg",

98+

]);

8299

expect(runFfmpegMock).not.toHaveBeenCalled();

83100

});

84101

@@ -98,10 +115,25 @@ describe("ensureOggOpus", () => {

98115

expect(result.cleanup).toBe(true);

99116

expect(path.dirname(result.path)).toBe(path.normalize("/tmp"));

100117

expect(path.basename(result.path)).toMatch(/^voice-.*\.ogg$/);

101-

expect(runFfmpegMock).toHaveBeenCalledWith(

102-

expect.arrayContaining(["-t", "1200", "-ar", "48000", "/tmp/input.ogg"]),

103-

);

104-

const ffmpegOutputPath = (runFfmpegMock.mock.calls[0]?.[0] as string[] | undefined)?.at(-1);

118+

expect(runFfmpegMock).toHaveBeenCalledTimes(1);

119+

const ffmpegArgs = readSingleCommandArgs(runFfmpegMock);

120+

expect(ffmpegArgs.slice(0, -1)).toEqual([

121+

"-y",

122+

"-i",

123+

"/tmp/input.ogg",

124+

"-vn",

125+

"-sn",

126+

"-dn",

127+

"-t",

128+

"1200",

129+

"-ar",

130+

"48000",

131+

"-c:a",

132+

"libopus",

133+

"-b:a",

134+

"64k",

135+

]);

136+

const ffmpegOutputPath = ffmpegArgs.at(-1);

105137

expectStagedFfmpegOutput(ffmpegOutputPath, result.path);

106138

await expect(fs.readFile(result.path, "utf8")).resolves.toBe("ogg");

107139

});

@@ -120,10 +152,25 @@ describe("ensureOggOpus", () => {

120152121153

expect(result.cleanup).toBe(true);

122154

expect(runFfprobeMock).not.toHaveBeenCalled();

123-

expect(runFfmpegMock).toHaveBeenCalledWith(

124-

expect.arrayContaining(["-vn", "-sn", "-dn", "/tmp/input.mp3"]),

125-

);

126-

const ffmpegOutputPath = (runFfmpegMock.mock.calls[0]?.[0] as string[] | undefined)?.at(-1);

155+

expect(runFfmpegMock).toHaveBeenCalledTimes(1);

156+

const ffmpegArgs = readSingleCommandArgs(runFfmpegMock);

157+

expect(ffmpegArgs.slice(0, -1)).toEqual([

158+

"-y",

159+

"-i",

160+

"/tmp/input.mp3",

161+

"-vn",

162+

"-sn",

163+

"-dn",

164+

"-t",

165+

"1200",

166+

"-ar",

167+

"48000",

168+

"-c:a",

169+

"libopus",

170+

"-b:a",

171+

"64k",

172+

]);

173+

const ffmpegOutputPath = ffmpegArgs.at(-1);

127174

expectStagedFfmpegOutput(ffmpegOutputPath, result.path);

128175

await expect(fs.readFile(result.path, "utf8")).resolves.toBe("ogg");

129176

});

@@ -215,13 +262,18 @@ describe("sendDiscordVoiceMessage", () => {

215262

expect(uploadUrlRequests).toBe(2);

216263

expect(fetchMock).toHaveBeenCalledTimes(4);

217264

expect(post).toHaveBeenCalledWith("/channels/channel-1/messages", {

218-

body: expect.objectContaining({

265+

body: {

266+

flags: 8192,

219267

attachments: [

220-

expect.objectContaining({

268+

{

269+

id: "0",

270+

filename: "voice-message.ogg",

221271

uploaded_filename: "uploaded-2.ogg",

222-

}),

272+

duration_secs: 1,

273+

waveform: "waveform",

274+

},

223275

],

224-

}),

276+

},

225277

});

226278

});

227279