






















@@ -3,6 +3,14 @@
33import { describe, expect, it, vi } from "vitest";
44import { submitRealtimeTalkConsult } from "./chat/realtime-talk-shared.js";
556+function requireFirstMockCall(calls: readonly unknown[][], label: string): unknown[] {
7+const call = calls.at(0);
8+if (!call) {
9+throw new Error(`expected ${label} call`);
10+}
11+return call;
12+}
13+614describe("RealtimeTalkSession consult handoff", () => {
715it("submits realtime consults through the Gateway tool-call endpoint", async () => {
816let listener: ((event: { event: string; payload?: unknown }) => void) | undefined;
@@ -41,7 +49,7 @@ describe("RealtimeTalkSession consult handoff", () => {
4149 submit,
4250});
435144-const toolCall = request.mock.calls[0] as
52+const toolCall = requireFirstMockCall(request.mock.calls, "Gateway request") as
4553| [string, { sessionKey?: string; name?: string; args?: { question?: string } }]
4654| undefined;
4755expect(toolCall?.[0]).toBe("talk.client.toolCall");
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。