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

推荐订阅源

Google DeepMind News
Google DeepMind News
I
InfoQ
Engineering at Meta
Engineering at Meta
D
DataBreaches.Net
L
LangChain Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Recent Announcements
Recent Announcements
GbyAI
GbyAI
爱范儿
爱范儿
Microsoft Security Blog
Microsoft Security Blog
腾讯CDC
美团技术团队
罗磊的独立博客
Microsoft Azure Blog
Microsoft Azure Blog
WordPress大学
WordPress大学
T
The Blog of Author Tim Ferriss
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
雷峰网
雷峰网
M
MIT News - Artificial intelligence
D
Docker
MongoDB | Blog
MongoDB | Blog
F
Fortinet All Blogs
博客园 - 叶小钗

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 discord voice mock reads · openclaw/openclaw...
steipete · 2026-05-13 · via Recent Commits to openclaw:main

@@ -378,7 +378,7 @@ describe("DiscordVoiceManager", () => {

378378379379

const lastMockCall = (source: MockCallSource, label: string) => {

380380

const calls = Array.from(source.mock.calls);

381-

const call = calls.at(-1);

381+

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

382382

if (!call) {

383383

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

384384

}

@@ -405,6 +405,18 @@ describe("DiscordVoiceManager", () => {

405405

`agent command args ${index}`,

406406

);

407407408+

const lastRealtimeBridgeParams = () =>

409+

requireRecord(

410+

lastMockCall(

411+

createRealtimeVoiceBridgeSessionMock as unknown as MockCallSource,

412+

"realtime bridge",

413+

)[0],

414+

"realtime bridge params",

415+

);

416+417+

const lastAudioResourceInput = () =>

418+

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

419+408420

const lastTtsArgs = () =>

409421

requireRecord(

410422

lastMockCall(textToSpeechMock as unknown as MockCallSource, "tts call")[0],

@@ -727,7 +739,7 @@ describe("DiscordVoiceManager", () => {

727739728740

const player = getLastAudioPlayer();

729741

const entry = getSessionEntry(manager);

730-

const bridgeParams = createRealtimeVoiceBridgeSessionMock.mock.calls.at(-1)?.[0] as

742+

const bridgeParams = lastRealtimeBridgeParams() as

731743

| {

732744

audioSink?: {

733745

sendAudio: (audio: Buffer) => void;

@@ -784,7 +796,7 @@ describe("DiscordVoiceManager", () => {

784796

) => { close: () => void; sendInputAudio: (audio: Buffer) => void };

785797

};

786798

};

787-

const bridgeParams = createRealtimeVoiceBridgeSessionMock.mock.calls.at(-1)?.[0] as

799+

const bridgeParams = lastRealtimeBridgeParams() as

788800

| {

789801

audioSink?: {

790802

sendAudio: (audio: Buffer) => void;

@@ -1059,7 +1071,7 @@ describe("DiscordVoiceManager", () => {

10591071

model: "gpt-realtime-2",

10601072

voice: "cedar",

10611073

});

1062-

const bridgeParams = createRealtimeVoiceBridgeSessionMock.mock.calls.at(-1)?.[0] as

1074+

const bridgeParams = lastRealtimeBridgeParams() as

10631075

| {

10641076

autoRespondToAudio?: boolean;

10651077

instructions?: string;

@@ -1121,7 +1133,7 @@ describe("DiscordVoiceManager", () => {

11211133

});

1122113411231135

await manager.join({ guildId: "g1", channelId: "1001" });

1124-

const bridgeParams = createRealtimeVoiceBridgeSessionMock.mock.calls.at(-1)?.[0] as

1136+

const bridgeParams = lastRealtimeBridgeParams() as

11251137

| {

11261138

onToolCall?: (

11271139

event: {

@@ -1189,7 +1201,7 @@ describe("DiscordVoiceManager", () => {

11891201

on: ReturnType<typeof vi.fn>;

11901202

play: ReturnType<typeof vi.fn>;

11911203

};

1192-

const bridgeParams = createRealtimeVoiceBridgeSessionMock.mock.calls.at(-1)?.[0] as

1204+

const bridgeParams = lastRealtimeBridgeParams() as

11931205

| {

11941206

audioSink?: {

11951207

sendAudio: (audio: Buffer) => void;

@@ -1201,9 +1213,7 @@ describe("DiscordVoiceManager", () => {

12011213

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

12021214

expect(createAudioResourceMock).toHaveBeenCalledTimes(1);

12031215

expect(player.play).toHaveBeenCalledTimes(1);

1204-

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

1205-

| { writableEnded?: boolean }

1206-

| undefined;

1216+

const firstStream = lastAudioResourceInput() as { writableEnded?: boolean } | undefined;

12071217

expect(firstStream?.writableEnded).toBe(false);

12081218

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

12091219

expect(firstStream?.writableEnded).toBe(true);

@@ -1287,7 +1297,7 @@ describe("DiscordVoiceManager", () => {

12871297

);

12881298

nonOwnerTurn?.sendInputAudio(Buffer.alloc(8));

128912991290-

const bridgeParams = createRealtimeVoiceBridgeSessionMock.mock.calls.at(-1)?.[0] as

1300+

const bridgeParams = lastRealtimeBridgeParams() as

12911301

| {

12921302

onTranscript?: (role: "user" | "assistant", text: string, isFinal: boolean) => void;

12931303

onEvent?: (event: { direction: "server"; type: string }) => void;

@@ -1328,7 +1338,7 @@ describe("DiscordVoiceManager", () => {

13281338

) => { close: () => void; sendInputAudio: (audio: Buffer) => void };

13291339

};

13301340

};

1331-

const bridgeParams = createRealtimeVoiceBridgeSessionMock.mock.calls.at(-1)?.[0] as

1341+

const bridgeParams = lastRealtimeBridgeParams() as

13321342

| {

13331343

onTranscript?: (role: "user" | "assistant", text: string, isFinal: boolean) => void;

13341344

onEvent?: (event: { direction: "server"; type: string }) => void;

@@ -1382,7 +1392,7 @@ describe("DiscordVoiceManager", () => {

13821392

) => { close: () => void; sendInputAudio: (audio: Buffer) => void };

13831393

};

13841394

};

1385-

const bridgeParams = createRealtimeVoiceBridgeSessionMock.mock.calls.at(-1)?.[0] as

1395+

const bridgeParams = lastRealtimeBridgeParams() as

13861396

| {

13871397

onTranscript?: (role: "user" | "assistant", text: string, isFinal: boolean) => void;

13881398

}

@@ -1461,7 +1471,7 @@ describe("DiscordVoiceManager", () => {

14611471

const player = getLastAudioPlayer() as {

14621472

on: ReturnType<typeof vi.fn>;

14631473

};

1464-

const bridgeParams = createRealtimeVoiceBridgeSessionMock.mock.calls.at(-1)?.[0] as

1474+

const bridgeParams = lastRealtimeBridgeParams() as

14651475

| {

14661476

audioSink?: { sendAudio: (audio: Buffer) => void };

14671477

onEvent?: (event: { direction: "server"; type: string }) => void;

@@ -1500,7 +1510,7 @@ describe("DiscordVoiceManager", () => {

15001510

expectUserMessageNotIncludes("third answer");

1501151115021512

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

1503-

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

1513+

const firstStream = lastAudioResourceInput() as PassThrough | undefined;

15041514

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

15051515

await new Promise<void>((resolve) => setImmediate(resolve));

15061516

expectUserMessageNotIncludes("second answer");

@@ -1514,7 +1524,7 @@ describe("DiscordVoiceManager", () => {

1514152415151525

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

15161526

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

1517-

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

1527+

const secondStream = lastAudioResourceInput() as PassThrough | undefined;

15181528

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

15191529

await new Promise<void>((resolve) => setImmediate(resolve));

15201530

expectUserMessageNotIncludes("third answer");

@@ -1546,7 +1556,7 @@ describe("DiscordVoiceManager", () => {

15461556

};

15471557

};

15481558

const player = getLastAudioPlayer();

1549-

const bridgeParams = createRealtimeVoiceBridgeSessionMock.mock.calls.at(-1)?.[0] as

1559+

const bridgeParams = lastRealtimeBridgeParams() as

15501560

| {

15511561

audioSink?: { sendAudio: (audio: Buffer) => void };

15521562

onEvent?: (event: { direction: "server"; type: string }) => void;

@@ -1582,7 +1592,7 @@ describe("DiscordVoiceManager", () => {

15821592

expectUserMessageNotIncludes("second answer");

1583159315841594

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

1585-

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

1595+

const firstStream = lastAudioResourceInput() as PassThrough | undefined;

15861596

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

15871597

await new Promise<void>((resolve) => setImmediate(resolve));

15881598

expectUserMessageNotIncludes("second answer");

@@ -1616,7 +1626,7 @@ describe("DiscordVoiceManager", () => {

16161626

) => { close: () => void; sendInputAudio: (audio: Buffer) => void };

16171627

};

16181628

};

1619-

const bridgeParams = createRealtimeVoiceBridgeSessionMock.mock.calls.at(-1)?.[0] as

1629+

const bridgeParams = lastRealtimeBridgeParams() as

16201630

| {

16211631

onToolCall?: (

16221632

event: {

@@ -1691,7 +1701,7 @@ describe("DiscordVoiceManager", () => {

16911701

) => { close: () => void; sendInputAudio: (audio: Buffer) => void };

16921702

};

16931703

};

1694-

const bridgeParams = createRealtimeVoiceBridgeSessionMock.mock.calls.at(-1)?.[0] as

1704+

const bridgeParams = lastRealtimeBridgeParams() as

16951705

| {

16961706

onToolCall?: (

16971707

event: {

@@ -1765,7 +1775,7 @@ describe("DiscordVoiceManager", () => {

17651775

) => { close: () => void; sendInputAudio: (audio: Buffer) => void };

17661776

};

17671777

};

1768-

const bridgeParams = createRealtimeVoiceBridgeSessionMock.mock.calls.at(-1)?.[0] as

1778+

const bridgeParams = lastRealtimeBridgeParams() as

17691779

| {

17701780

onToolCall?: (

17711781

event: {

@@ -1837,7 +1847,7 @@ describe("DiscordVoiceManager", () => {

18371847

) => { close: () => void; sendInputAudio: (audio: Buffer) => void };

18381848

};

18391849

};

1840-

const bridgeParams = createRealtimeVoiceBridgeSessionMock.mock.calls.at(-1)?.[0] as

1850+

const bridgeParams = lastRealtimeBridgeParams() as

18411851

| {

18421852

onToolCall?: (

18431853

event: {

@@ -1919,7 +1929,7 @@ describe("DiscordVoiceManager", () => {

19191929

) => { close: () => void; sendInputAudio: (audio: Buffer) => void };

19201930

};

19211931

};

1922-

const bridgeParams = createRealtimeVoiceBridgeSessionMock.mock.calls.at(-1)?.[0] as

1932+

const bridgeParams = lastRealtimeBridgeParams() as

19231933

| {

19241934

onToolCall?: (

19251935

event: {

@@ -2021,7 +2031,7 @@ describe("DiscordVoiceManager", () => {

20212031

);

20222032

guestTurn?.sendInputAudio(Buffer.alloc(8));

202320332024-

const bridgeParams = createRealtimeVoiceBridgeSessionMock.mock.calls.at(-1)?.[0] as

2034+

const bridgeParams = lastRealtimeBridgeParams() as

20252035

| {

20262036

onTranscript?: (role: "user" | "assistant", text: string, isFinal: boolean) => void;

20272037

}

@@ -2073,7 +2083,7 @@ describe("DiscordVoiceManager", () => {

20732083

);

20742084

ownerTurn?.sendInputAudio(Buffer.alloc(8));

207520852076-

const bridgeParams = createRealtimeVoiceBridgeSessionMock.mock.calls.at(-1)?.[0] as

2086+

const bridgeParams = lastRealtimeBridgeParams() as

20772087

| {

20782088

autoRespondToAudio?: boolean;

20792089

interruptResponseOnInputAudio?: boolean;

@@ -2182,7 +2192,7 @@ describe("DiscordVoiceManager", () => {

21822192

);

21832193

ownerTurn?.sendInputAudio(Buffer.alloc(8));

218421942185-

const bridgeParams = createRealtimeVoiceBridgeSessionMock.mock.calls.at(-1)?.[0] as

2195+

const bridgeParams = lastRealtimeBridgeParams() as

21862196

| {

21872197

onToolCall?: (

21882198

event: {

@@ -2250,7 +2260,7 @@ describe("DiscordVoiceManager", () => {

22502260

);

22512261

ownerTurn?.sendInputAudio(Buffer.alloc(8));

225222622253-

const bridgeParams = createRealtimeVoiceBridgeSessionMock.mock.calls.at(-1)?.[0] as

2263+

const bridgeParams = lastRealtimeBridgeParams() as

22542264

| {

22552265

onToolCall?: (

22562266

event: {

@@ -2323,7 +2333,7 @@ describe("DiscordVoiceManager", () => {

23232333

);

23242334

guestTurn?.sendInputAudio(Buffer.alloc(8));

232523352326-

const bridgeParams = createRealtimeVoiceBridgeSessionMock.mock.calls.at(-1)?.[0] as

2336+

const bridgeParams = lastRealtimeBridgeParams() as

23272337

| {

23282338

onToolCall?: (

23292339

event: {

@@ -2628,9 +2638,7 @@ describe("DiscordVoiceManager", () => {

26282638

const manager = createManager({ groupPolicy: "open", allowFrom: ["discord:u-owner"] }, client);

26292639

await processVoiceSegment(manager, "u-owner");

263026402631-

const commandArgs = agentCommandMock.mock.calls.at(-1)?.[0] as

2632-

| { senderIsOwner?: boolean }

2633-

| undefined;

2641+

const commandArgs = lastAgentCommandArgs() as { senderIsOwner?: boolean } | undefined;

26342642

expect(commandArgs?.senderIsOwner).toBe(true);

26352643

});

26362644

@@ -2650,9 +2658,7 @@ describe("DiscordVoiceManager", () => {

26502658

});

26512659

await processVoiceSegment(manager, "u-guest");

265226602653-

const commandArgs = agentCommandMock.mock.calls.at(-1)?.[0] as

2654-

| { senderIsOwner?: boolean }

2655-

| undefined;

2661+

const commandArgs = lastAgentCommandArgs() as { senderIsOwner?: boolean } | undefined;

26562662

expect(commandArgs?.senderIsOwner).toBe(false);

26572663

});

26582664

@@ -2681,7 +2687,7 @@ describe("DiscordVoiceManager", () => {

26812687

);

26822688

await processVoiceSegment(manager, "u-guest");

268326892684-

const commandArgs = agentCommandMock.mock.calls.at(-1)?.[0] as

2690+

const commandArgs = lastAgentCommandArgs() as

26852691

| { allowModelOverride?: boolean; model?: string }

26862692

| undefined;

26872693

@@ -2709,7 +2715,7 @@ describe("DiscordVoiceManager", () => {

27092715

});

27102716

await processVoiceSegment(manager, "u-guest");

271127172712-

const commandArgs = agentCommandMock.mock.calls.at(-1)?.[0] as

2718+

const commandArgs = lastAgentCommandArgs() as

27132719

| { message?: string; messageChannel?: string; messageProvider?: string }

27142720

| undefined;

27152721

@@ -2825,9 +2831,7 @@ describe("DiscordVoiceManager", () => {

28252831

);

28262832

await processVoiceSegment(manager, "u-guest");

282728332828-

const commandArgs = agentCommandMock.mock.calls.at(-1)?.[0] as

2829-

| { extraSystemPrompt?: string }

2830-

| undefined;

2834+

const commandArgs = lastAgentCommandArgs() as { extraSystemPrompt?: string } | undefined;

2831283528322836

expect(commandArgs?.extraSystemPrompt).toBe("Use short voice replies.");

28332837

});