


























@@ -30,6 +30,7 @@ import {
3030convertGoogleMeetTtsAudioForBridge,
3131extendGoogleMeetOutputEchoSuppression,
3232isGoogleMeetLikelyAssistantEchoTranscript,
33+GOOGLE_MEET_AGENT_TRANSCRIPT_DEBOUNCE_MS,
3334resolveGoogleMeetRealtimeProvider,
3435resolveGoogleMeetRealtimeTranscriptionProvider,
3536startCommandAgentAudioBridge,
@@ -315,6 +316,7 @@ describe("google-meet plugin", () => {
315316});
316317317318afterEach(() => {
319+vi.useRealTimers();
318320vi.unstubAllGlobals();
319321chromeTransportTesting.setDepsForTest(null);
320322googleMeetPluginTesting.setCallGatewayFromCliForTests();
@@ -1250,14 +1252,16 @@ describe("google-meet plugin", () => {
12501252introSent: true,
12511253},
12521254});
1253-expect(voiceCallMocks.joinMeetViaVoiceCallGateway).toHaveBeenCalledWith({
1254-config: expect.objectContaining({ defaultTransport: "twilio" }),
1255-dialInNumber: "+15551234567",
1256-dtmfSequence: "123456#",
1257-logger: expect.objectContaining({ info: expect.any(Function) }),
1258-message: "Say exactly: I'm here and listening.",
1259-sessionKey: expect.stringMatching(/^voice:google-meet:meet_/),
1260-});
1255+expect(voiceCallMocks.joinMeetViaVoiceCallGateway).toHaveBeenCalledWith(
1256+expect.objectContaining({
1257+config: expect.objectContaining({ defaultTransport: "twilio" }),
1258+dialInNumber: "+15551234567",
1259+dtmfSequence: "123456#",
1260+logger: expect.objectContaining({ info: expect.any(Function) }),
1261+message: "Say exactly: I'm here and listening.",
1262+sessionKey: expect.stringMatching(/^voice:google-meet:meet_/),
1263+}),
1264+);
12611265});
1262126612631267it("passes the caller session key through tool joins for agent context forking", async () => {
@@ -2762,6 +2766,7 @@ describe("google-meet plugin", () => {
27622766url: "https://meet.google.com/abc-defg-hij",
27632767});
27642768const { methods } = setup({
2769+realtime: { introMessage: "" },
27652770chrome: {
27662771audioBridgeCommand: ["bridge", "start"],
27672772waitForInCallMs: 1,
@@ -3781,6 +3786,7 @@ describe("google-meet plugin", () => {
37813786const { methods, runCommandWithTimeout } = setup({
37823787defaultMode: "bidi",
37833788chrome: {
3789+waitForInCallMs: 1,
37843790audioBridgeHealthCommand: ["bridge", "status"],
37853791audioBridgeCommand: ["bridge", "start"],
37863792},
@@ -3822,6 +3828,7 @@ describe("google-meet plugin", () => {
38223828});
3823382938243830it("uses realtime transcription plus regular TTS in Chrome agent mode", async () => {
3831+vi.useFakeTimers();
38253832let callbacks: Parameters<RealtimeTranscriptionProviderPlugin["createSession"]>[0] | undefined;
38263833const sendAudio = vi.fn();
38273834const sttSession = {
@@ -3919,7 +3926,7 @@ describe("google-meet plugin", () => {
39193926);
39203927inputStdout.write(Buffer.from([1, 0, 2, 0, 3, 0, 4, 0]));
39213928callbacks?.onTranscript?.("Please summarize the launch.");
3922-await new Promise((resolve) => setTimeout(resolve, 1100));
3929+await vi.advanceTimersByTimeAsync(GOOGLE_MEET_AGENT_TRANSCRIPT_DEBOUNCE_MS);
3923393039243931expect(sendAudio).toHaveBeenCalledWith(expect.any(Buffer));
39253932expect(runtime.agent.runEmbeddedPiAgent).toHaveBeenCalled();
@@ -4497,7 +4504,7 @@ describe("google-meet plugin", () => {
44974504if (pullCount === 1) {
44984505return { bridgeId: "bridge-1", base64: Buffer.from([9, 8, 7]).toString("base64") };
44994506}
4500-await new Promise((resolve) => setTimeout(resolve, 1_000));
4507+await new Promise((resolve) => setTimeout(resolve, 10));
45014508return { bridgeId: "bridge-1" };
45024509}
45034510return { ok: true };
@@ -4683,7 +4690,7 @@ describe("google-meet plugin", () => {
46834690if (pullCount === 2) {
46844691return { bridgeId: "bridge-1", base64: Buffer.from([5, 4, 3]).toString("base64") };
46854692}
4686-await new Promise((resolve) => setTimeout(resolve, 1_000));
4693+await new Promise((resolve) => setTimeout(resolve, 10));
46874694return { bridgeId: "bridge-1" };
46884695}
46894696return { ok: true };
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。