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

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
爱范儿
爱范儿
H
Help Net Security
V
Visual Studio Blog
J
Java Code Geeks
Stack Overflow Blog
Stack Overflow Blog
Microsoft Security Blog
Microsoft Security Blog
Apple Machine Learning Research
Apple Machine Learning Research
MyScale Blog
MyScale Blog
The Cloudflare Blog
Martin Fowler
Martin Fowler
D
Docker
腾讯CDC
F
Fortinet All Blogs
雷峰网
雷峰网
GbyAI
GbyAI
G
Google Developers Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Recent Announcements
Recent Announcements
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Blog — PlanetScale
Blog — PlanetScale
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: guard voice call mock calls · openclaw/openclaw@884...
steipete · 2026-05-12 · via Recent Commits to openclaw:main

@@ -326,9 +326,9 @@ describe("voice-call plugin", () => {

326326

await service?.start(createServiceContext());

327327328328

expect(createVoiceCallRuntime).toHaveBeenCalledTimes(1);

329-

expect(vi.mocked(createVoiceCallRuntime).mock.calls[0]?.[0]?.config.twilio?.authToken).toEqual(

330-

authToken,

331-

);

329+

expect(

330+

vi.mocked(createVoiceCallRuntime).mock.calls.at(0)?.[0]?.config.twilio?.authToken,

331+

).toEqual(authToken);

332332

});

333333334334

it("still reports missing provider setup when a command needs the runtime", async () => {

@@ -347,7 +347,7 @@ describe("voice-call plugin", () => {

347347

await handler?.({ params: { message: "Hi", to: "+15550001234" }, respond });

348348349349

expect(createVoiceCallRuntime).not.toHaveBeenCalled();

350-

const [ok, payload, error] = respond.mock.calls[0] ?? [];

350+

const [ok, payload, error] = respond.mock.calls.at(0) ?? [];

351351

expect(ok).toBe(false);

352352

expect(payload).toBeUndefined();

353353

expect(String((error as { message?: unknown } | undefined)?.message)).toContain(

@@ -366,7 +366,7 @@ describe("voice-call plugin", () => {

366366

const respond = vi.fn();

367367

await handler?.({ params: { message: "Hi" }, respond });

368368

expect(runtimeStub.manager.initiateCall).toHaveBeenCalled();

369-

const [ok, payload] = respond.mock.calls[0];

369+

const [ok, payload] = respond.mock.calls.at(0) ?? [];

370370

expect(ok).toBe(true);

371371

expect(payload.callId).toBe("call-1");

372372

});

@@ -412,7 +412,7 @@ describe("voice-call plugin", () => {

412412

message: "Hi",

413413

mode: "conversation",

414414

});

415-

expect(respond.mock.calls[0]?.[0]).toBe(true);

415+

expect(respond.mock.calls.at(0)?.[0]).toBe(true);

416416

});

417417418418

it("preserves explicit session keys on voicecall.start", async () => {

@@ -443,7 +443,7 @@ describe("voice-call plugin", () => {

443443

requesterSessionKey: "agent:main:discord:channel:general",

444444

},

445445

);

446-

expect(respond.mock.calls[0]?.[0]).toBe(true);

446+

expect(respond.mock.calls.at(0)?.[0]).toBe(true);

447447

});

448448449449

it("returns call status", async () => {

@@ -456,7 +456,7 @@ describe("voice-call plugin", () => {

456456

| undefined;

457457

const respond = vi.fn();

458458

await handler?.({ params: { callId: "call-1" }, respond });

459-

const [ok, payload] = respond.mock.calls[0];

459+

const [ok, payload] = respond.mock.calls.at(0) ?? [];

460460

expect(ok).toBe(true);

461461

expect(payload.found).toBe(true);

462462

});

@@ -474,7 +474,7 @@ describe("voice-call plugin", () => {

474474

await handler?.({ params: { callId: "call-1", digits: "ww123#" }, respond });

475475476476

expect(runtimeStub.manager.sendDtmf).toHaveBeenCalledWith("call-1", "ww123#");

477-

expect(respond.mock.calls[0]).toEqual([true, { success: true }]);

477+

expect(respond.mock.calls.at(0)).toEqual([true, { success: true }]);

478478

});

479479480480

it("normalizes provider call ids before speaking", async () => {

@@ -497,7 +497,7 @@ describe("voice-call plugin", () => {

497497

await handler?.({ params: { callId: "CA123", message: "hello" }, respond });

498498499499

expect(runtimeStub.manager.speak).toHaveBeenCalledWith("call-1", "hello");

500-

expect(respond.mock.calls[0]).toEqual([true, { success: true }]);

500+

expect(respond.mock.calls.at(0)).toEqual([true, { success: true }]);

501501

});

502502503503

it("does not fall back to one-shot TwiML speak when realtime-only speech is requested", async () => {

@@ -518,7 +518,7 @@ describe("voice-call plugin", () => {

518518519519

expect(runtimeStub.webhookServer.speakRealtime).toHaveBeenCalledWith("call-1", "hello");

520520

expect(runtimeStub.manager.speak).not.toHaveBeenCalled();

521-

expect(respond.mock.calls[0]).toEqual([

521+

expect(respond.mock.calls.at(0)).toEqual([

522522

true,

523523

{ success: false, error: "No active realtime bridge for call" },

524524

]);

@@ -547,7 +547,7 @@ describe("voice-call plugin", () => {

547547548548

await handler?.({ params: { callId: "CA123", message: "hello" }, respond });

549549550-

const [ok, , error] = respond.mock.calls[0] ?? [];

550+

const [ok, , error] = respond.mock.calls.at(0) ?? [];

551551

expect(ok).toBe(false);

552552

expect(error.message).toContain("call is not active");

553553

expect(error.message).toContain("last state=completed");

@@ -579,7 +579,7 @@ describe("voice-call plugin", () => {

579579

await handler?.({ params: { callId: "call-1" }, respond });

580580581581

expect(vi.mocked(createVoiceCallRuntime)).toHaveBeenCalledTimes(1);

582-

const runtimeConfig = vi.mocked(createVoiceCallRuntime).mock.calls[0]?.[0]?.config;

582+

const runtimeConfig = vi.mocked(createVoiceCallRuntime).mock.calls.at(0)?.[0]?.config;

583583

expect(runtimeConfig?.enabled).toBe(true);

584584

expect(runtimeConfig?.provider).toBe("mock");

585585

expect(runtimeConfig?.fromNumber).toBe("+15550001234");

@@ -707,7 +707,7 @@ describe("voice-call plugin", () => {

707707708708

await handler?.({ params: {}, respond });

709709710-

const [ok, payload, error] = respond.mock.calls[0] ?? [];

710+

const [ok, payload, error] = respond.mock.calls.at(0) ?? [];

711711

expect(ok).toBe(false);

712712

expect(payload).toBeUndefined();

713713

expect((error as { code?: unknown } | undefined)?.code).toBe("INVALID_REQUEST");

@@ -791,7 +791,7 @@ describe("voice-call plugin", () => {

791791

params: { callId: "call-1", message: "Hello" },

792792

respond: startRespond,

793793

});

794-

const startPayload = startRespond.mock.calls[0]?.[1] as

794+

const startPayload = startRespond.mock.calls.at(0)?.[1] as

795795

| { operationId?: string; pollTimeoutMs?: number; status?: string }

796796

| undefined;

797797

expect(startPayload?.operationId).toMatch(

@@ -806,8 +806,8 @@ describe("voice-call plugin", () => {

806806

params: { operationId: startPayload?.operationId },

807807

respond: pendingRespond,

808808

});

809-

expect(pendingRespond.mock.calls[0]?.[0]).toBe(true);

810-

expect((pendingRespond.mock.calls[0]?.[1] as { status?: unknown } | undefined)?.status).toBe(

809+

expect(pendingRespond.mock.calls.at(0)?.[0]).toBe(true);

810+

expect((pendingRespond.mock.calls.at(0)?.[1] as { status?: unknown } | undefined)?.status).toBe(

811811

"pending",

812812

);

813813

@@ -820,10 +820,10 @@ describe("voice-call plugin", () => {

820820

params: { operationId: startPayload?.operationId },

821821

respond: completedRespond,

822822

});

823-

const completedPayload = completedRespond.mock.calls[0]?.[1] as

823+

const completedPayload = completedRespond.mock.calls.at(0)?.[1] as

824824

| { status?: unknown; result?: unknown }

825825

| undefined;

826-

expect(completedRespond.mock.calls[0]?.[0]).toBe(true);

826+

expect(completedRespond.mock.calls.at(0)?.[0]).toBe(true);

827827

expect(completedPayload?.status).toBe("completed");

828828

expect(completedPayload?.result).toEqual({ success: true, transcript: "gateway hello" });

829829

});