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

推荐订阅源

Microsoft Security Blog
Microsoft Security Blog
J
Java Code Geeks
GbyAI
GbyAI
aimingoo的专栏
aimingoo的专栏
L
LangChain Blog
I
InfoQ
D
Docker
F
Fortinet All Blogs
Y
Y Combinator Blog
Martin Fowler
Martin Fowler
月光博客
月光博客
B
Blog
Engineering at Meta
Engineering at Meta
T
Tailwind CSS Blog
罗磊的独立博客
博客园_首页
G
Google Developers Blog
Stack Overflow Blog
Stack Overflow Blog
Recent Announcements
Recent Announcements
D
DataBreaches.Net
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
B
Blog RSS Feed
IT之家
IT之家
V
V2EX

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: dedupe tts command mock reads · openclaw/openclaw@6...
steipete · 2026-05-13 · via Recent Commits to openclaw:main

@@ -81,6 +81,15 @@ function expectReply(

8181

return handled.reply;

8282

}

838384+

function lastMockCall(mock: { mock: { calls: unknown[][] } }, label: string): unknown[] {

85+

const calls = mock.mock.calls;

86+

const call = calls[calls.length - 1];

87+

if (!call) {

88+

throw new Error(`expected ${label} call`);

89+

}

90+

return call;

91+

}

92+8493

describe("handleTtsCommands status fallback reporting", () => {

8594

beforeEach(() => {

8695

vi.clearAllMocks();

@@ -224,10 +233,11 @@ describe("handleTtsCommands status fallback reporting", () => {

224233

const result = await handleTtsCommands(buildTtsParams("/tts status", cfg, "reader"), true);

225234226235

expectHandled(result);

227-

const resolveCall = ttsMocks.resolveTtsConfig.mock.calls.at(-1);

228-

expect(resolveCall?.[0]).toBe(cfg);

229-

expect(resolveCall?.[1]?.agentId).toBe("reader");

230-

expect(resolveCall?.[1]?.channelId).toBe("forum");

236+

const resolveCall = lastMockCall(ttsMocks.resolveTtsConfig, "resolveTtsConfig");

237+

const resolveOptions = resolveCall[1] as { agentId?: string; channelId?: string };

238+

expect(resolveCall[0]).toBe(cfg);

239+

expect(resolveOptions.agentId).toBe("reader");

240+

expect(resolveOptions.channelId).toBe("forum");

231241

});

232242233243

it("passes the active agent and account ids to /tts audio synthesis", async () => {

@@ -249,11 +259,16 @@ describe("handleTtsCommands status fallback reporting", () => {

249259

);

250260251261

expectHandled(result);

252-

const speechCall = ttsMocks.textToSpeech.mock.calls.at(-1)?.[0];

253-

expect(speechCall?.text).toBe("hello");

254-

expect(speechCall?.cfg).toBe(cfg);

255-

expect(speechCall?.agentId).toBe("reader");

256-

expect(speechCall?.accountId).toBe("feishu-main");

262+

const speechCall = lastMockCall(ttsMocks.textToSpeech, "textToSpeech")[0] as {

263+

accountId?: string;

264+

agentId?: string;

265+

cfg?: OpenClawConfig;

266+

text?: string;

267+

};

268+

expect(speechCall.text).toBe("hello");

269+

expect(speechCall.cfg).toBe(cfg);

270+

expect(speechCall.agentId).toBe("reader");

271+

expect(speechCall.accountId).toBe("feishu-main");

257272

});

258273259274

it("lists and sets configured TTS personas", async () => {

@@ -333,7 +348,10 @@ describe("handleTtsCommands status fallback reporting", () => {

333348

expect(reply.mediaUrl).toBe("/tmp/latest.ogg");

334349

expect(reply.audioAsVoice).toBe(true);

335350

expect(reply.spokenText).toBe("latest visible reply");

336-

expect(ttsMocks.textToSpeech.mock.calls.at(-1)?.[0]?.text).toBe("latest visible reply");

351+

const speechCall = lastMockCall(ttsMocks.textToSpeech, "textToSpeech")[0] as {

352+

text?: string;

353+

};

354+

expect(speechCall.text).toBe("latest visible reply");

337355

expect(sessionEntry.lastTtsReadLatestHash).toMatch(/^[a-f0-9]{64}$/);

338356

expect(sessionEntry.lastTtsReadLatestAt).toBeGreaterThanOrEqual(beforeTtsRead);

339357

});