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

推荐订阅源

云风的 BLOG
云风的 BLOG
博客园 - 三生石上(FineUI控件)
WordPress大学
WordPress大学
F
Fortinet All Blogs
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 叶小钗
爱范儿
爱范儿
美团技术团队
H
Hackread – Cybersecurity News, Data Breaches, AI and More
有赞技术团队
有赞技术团队
博客园_首页
T
The Blog of Author Tim Ferriss
T
Tailwind CSS Blog
V
Visual Studio Blog
Jina AI
Jina AI
博客园 - Franky
量子位
MongoDB | Blog
MongoDB | Blog
L
LangChain Blog
Apple Machine Learning Research
Apple Machine Learning Research
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
U
Unit 42
aimingoo的专栏
aimingoo的专栏
M
MIT News - Artificial intelligence

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: clear discord voice manager broad matchers · opencl...
steipete · 2026-05-11 · via Recent Commits to openclaw:main

@@ -414,6 +414,23 @@ describe("DiscordVoiceManager", () => {

414414

"tts stream args",

415415

);

416416417+

const sentUserMessages = () =>

418+

Array.from(realtimeSessionMock.sendUserMessage.mock.calls).map(([message]) => String(message));

419+420+

const expectUserMessageIncludes = (text: string) => {

421+

expect(

422+

sentUserMessages().some((message) => message.includes(text)),

423+

text,

424+

).toBe(true);

425+

};

426+427+

const expectUserMessageNotIncludes = (text: string) => {

428+

expect(

429+

sentUserMessages().some((message) => message.includes(text)),

430+

text,

431+

).toBe(false);

432+

};

433+417434

const emitDecryptFailure = (manager: InstanceType<typeof managerModule.DiscordVoiceManager>) => {

418435

const entry = getSessionEntry(manager);

419436

(

@@ -1214,9 +1231,7 @@ describe("DiscordVoiceManager", () => {

1214123112151232

expect(lastAgentCommandArgs().senderIsOwner).toBe(false);

12161233

expect(realtimeSessionMock.handleBargeIn).not.toHaveBeenCalled();

1217-

expect(realtimeSessionMock.sendUserMessage).toHaveBeenCalledWith(

1218-

expect.stringContaining("non-owner answer"),

1219-

);

1234+

expectUserMessageIncludes("non-owner answer");

12201235

});

1221123612221237

it("keeps separate forced agent-proxy fallback timers for rapid transcripts", async () => {

@@ -1271,12 +1286,8 @@ describe("DiscordVoiceManager", () => {

12711286

const ownerCommandArgs = agentCommandArgsAt(1);

12721287

expect(ownerCommandArgs.message).toContain("owner question");

12731288

expect(ownerCommandArgs.senderIsOwner).toBe(true);

1274-

expect(realtimeSessionMock.sendUserMessage).toHaveBeenCalledWith(

1275-

expect.stringContaining("guest answer"),

1276-

);

1277-

expect(realtimeSessionMock.sendUserMessage).toHaveBeenCalledWith(

1278-

expect.stringContaining("owner answer"),

1279-

);

1289+

expectUserMessageIncludes("guest answer");

1290+

expectUserMessageIncludes("owner answer");

12801291

});

1281129212821293

it("skips incomplete and non-actionable forced agent-proxy transcripts", async () => {

@@ -1331,9 +1342,7 @@ describe("DiscordVoiceManager", () => {

1331134213321343

await new Promise((resolve) => setTimeout(resolve, 260));

13331344

expect(lastAgentCommandArgs().message).toContain("ship it.");

1334-

expect(realtimeSessionMock.sendUserMessage).toHaveBeenCalledWith(

1335-

expect.stringContaining("valid answer"),

1336-

);

1345+

expectUserMessageIncludes("valid answer");

13371346

});

1338134713391348

it("queues forced agent-proxy answers until current realtime playback idles", async () => {

@@ -1409,55 +1418,37 @@ describe("DiscordVoiceManager", () => {

14091418

await new Promise((resolve) => setTimeout(resolve, 260));

1410141914111420

resolveFirst?.({ payloads: [{ text: "first answer" }] });

1412-

await vi.waitFor(() =>

1413-

expect(realtimeSessionMock.sendUserMessage).toHaveBeenCalledWith(

1414-

expect.stringContaining("first answer"),

1415-

),

1416-

);

1421+

await vi.waitFor(() => expectUserMessageIncludes("first answer"));

14171422

bridgeParams?.audioSink?.sendAudio(Buffer.alloc(480));

1418142314191424

resolveSecond?.({ payloads: [{ text: "second answer" }] });

14201425

resolveThird?.({ payloads: [{ text: "third answer" }] });

14211426

await new Promise((resolve) => setTimeout(resolve, 0));

1422-

expect(realtimeSessionMock.sendUserMessage).not.toHaveBeenCalledWith(

1423-

expect.stringContaining("second answer"),

1424-

);

1425-

expect(realtimeSessionMock.sendUserMessage).not.toHaveBeenCalledWith(

1426-

expect.stringContaining("third answer"),

1427-

);

1427+

expectUserMessageNotIncludes("second answer");

1428+

expectUserMessageNotIncludes("third answer");

1428142914291430

bridgeParams?.onEvent?.({ direction: "server", type: "response.done" });

14301431

const firstStream = createAudioResourceMock.mock.calls.at(-1)?.[0] as PassThrough | undefined;

14311432

await vi.waitFor(() => expect(firstStream?.writableEnded).toBe(true));

14321433

await new Promise((resolve) => setTimeout(resolve, 0));

1433-

expect(realtimeSessionMock.sendUserMessage).not.toHaveBeenCalledWith(

1434-

expect.stringContaining("second answer"),

1435-

);

1434+

expectUserMessageNotIncludes("second answer");

1436143514371436

const idleHandler = player.on.mock.calls.find(([event]) => event === "idle")?.[1] as

14381437

| (() => void)

14391438

| undefined;

14401439

idleHandler?.();

1441-

expect(realtimeSessionMock.sendUserMessage).toHaveBeenCalledWith(

1442-

expect.stringContaining("second answer"),

1443-

);

1444-

expect(realtimeSessionMock.sendUserMessage).not.toHaveBeenCalledWith(

1445-

expect.stringContaining("third answer"),

1446-

);

1440+

expectUserMessageIncludes("second answer");

1441+

expectUserMessageNotIncludes("third answer");

1447144214481443

bridgeParams?.audioSink?.sendAudio(Buffer.alloc(480));

14491444

bridgeParams?.onEvent?.({ direction: "server", type: "response.done" });

14501445

const secondStream = createAudioResourceMock.mock.calls.at(-1)?.[0] as PassThrough | undefined;

14511446

await vi.waitFor(() => expect(secondStream?.writableEnded).toBe(true));

14521447

await new Promise((resolve) => setTimeout(resolve, 0));

1453-

expect(realtimeSessionMock.sendUserMessage).not.toHaveBeenCalledWith(

1454-

expect.stringContaining("third answer"),

1455-

);

1448+

expectUserMessageNotIncludes("third answer");

1456144914571450

idleHandler?.();

1458-

expect(realtimeSessionMock.sendUserMessage).toHaveBeenCalledWith(

1459-

expect.stringContaining("third answer"),

1460-

);

1451+

expectUserMessageIncludes("third answer");

14611452

});

1462145314631454

it("matches agent-proxy consult tool calls to the pending transcript", async () => {

@@ -1534,9 +1525,7 @@ describe("DiscordVoiceManager", () => {

15341525

expect(realtimeSessionMock.submitToolResult).toHaveBeenCalledWith("call-owner", {

15351526

text: "owner answer",

15361527

});

1537-

expect(realtimeSessionMock.sendUserMessage).toHaveBeenCalledWith(

1538-

expect.stringContaining("guest fallback answer"),

1539-

);

1528+

expectUserMessageIncludes("guest fallback answer");

15401529

});

1541153015421531

it("reuses forced agent-proxy answers for late matching consult tool calls", async () => {

@@ -1597,9 +1586,7 @@ describe("DiscordVoiceManager", () => {

15971586

await Promise.resolve();

1598158715991588

expect(agentCommandMock).toHaveBeenCalledTimes(1);

1600-

expect(realtimeSessionMock.sendUserMessage).toHaveBeenCalledWith(

1601-

expect.stringContaining("forced answer"),

1602-

);

1589+

expectUserMessageIncludes("forced answer");

16031590

expect(realtimeSessionMock.submitToolResult).toHaveBeenCalledWith(

16041591

"call-late",

16051592

{

@@ -1675,9 +1662,7 @@ describe("DiscordVoiceManager", () => {

16751662

await new Promise((resolve) => setTimeout(resolve, 20));

1676166316771664

expect(agentCommandMock).toHaveBeenCalledTimes(1);

1678-

expect(realtimeSessionMock.sendUserMessage).toHaveBeenCalledWith(

1679-

expect.stringContaining("I hit an error while checking that. Please try again."),

1680-

);

1665+

expectUserMessageIncludes("I hit an error while checking that. Please try again.");

16811666

expect(realtimeSessionMock.submitToolResult).toHaveBeenCalledWith(

16821667

"call-late",

16831668

{

@@ -1754,9 +1739,7 @@ describe("DiscordVoiceManager", () => {

17541739

await Promise.resolve();

1755174017561741

expect(agentCommandMock).toHaveBeenCalledTimes(1);

1757-

expect(realtimeSessionMock.sendUserMessage).toHaveBeenCalledWith(

1758-

expect.stringContaining("forced answer"),

1759-

);

1742+

expectUserMessageIncludes("forced answer");

17601743

expect(realtimeSessionMock.submitToolResult).toHaveBeenCalledWith("call-late", {

17611744

error: "Discord speaker context changed before this realtime consult completed",

17621745

});

@@ -1769,9 +1752,7 @@ describe("DiscordVoiceManager", () => {

17691752

const followupCommandArgs = agentCommandArgsAt(1);

17701753

expect(followupCommandArgs.message).toContain("guest followup");

17711754

expect(followupCommandArgs.senderIsOwner).toBe(false);

1772-

expect(realtimeSessionMock.sendUserMessage).toHaveBeenCalledWith(

1773-

expect.stringContaining("guest answer"),

1774-

);

1755+

expectUserMessageIncludes("guest answer");

17751756

});

1776175717771758

it("prefers the newest recent agent-proxy consult for repeated questions", async () => {

@@ -1854,9 +1835,7 @@ describe("DiscordVoiceManager", () => {

18541835

await Promise.resolve();

1855183618561837

expect(agentCommandMock).toHaveBeenCalledTimes(2);

1857-

expect(realtimeSessionMock.sendUserMessage).toHaveBeenCalledWith(

1858-

expect.stringContaining("new forced answer"),

1859-

);

1838+

expectUserMessageIncludes("new forced answer");

18601839

expect(realtimeSessionMock.submitToolResult).toHaveBeenCalledWith(

18611840

"call-new",

18621841

{

@@ -1911,9 +1890,7 @@ describe("DiscordVoiceManager", () => {

19111890

await new Promise((resolve) => setTimeout(resolve, 260));

1912189119131892

expect(lastAgentCommandArgs().senderIsOwner).toBe(false);

1914-

expect(realtimeSessionMock.sendUserMessage).toHaveBeenCalledWith(

1915-

expect.stringContaining("guest answer"),

1916-

);

1893+

expectUserMessageIncludes("guest answer");

19171894

});

1918189519191896

it("starts Discord realtime voice in bidi mode with the consult tool", async () => {

@@ -2669,7 +2646,9 @@ describe("DiscordVoiceManager", () => {

26692646

expect(lastTtsStreamArgs().disableFallback).toBe(true);

26702647

expect(lastTtsStreamArgs().text).toBe("hello back");

26712648

expect(textToSpeechMock).not.toHaveBeenCalled();

2672-

expect(createAudioResourceMock).toHaveBeenCalledWith(expect.anything());

2649+

expect(

2650+

lastMockCall(createAudioResourceMock as unknown as MockCallSource, "audio resource")[0],

2651+

).toBeDefined();

26732652

await vi.waitFor(() => expect(release).toHaveBeenCalledTimes(1));

26742653

});

26752654