





















@@ -171,6 +171,10 @@ describe("google-meet plugin", () => {
171171chrome: {
172172audioBackend: "blackhole-2ch",
173173launch: true,
174+guestName: "OpenClaw Agent",
175+reuseExistingTab: true,
176+autoJoin: true,
177+waitForInCallMs: 20000,
174178audioInputCommand: [
175179"rec",
176180"-q",
@@ -285,7 +289,16 @@ describe("google-meet plugin", () => {
285289properties: {
286290action: {
287291type: "string",
288-enum: ["join", "status", "setup_status", "resolve_space", "preflight", "leave", "speak"],
292+enum: [
293+"join",
294+"status",
295+"setup_status",
296+"resolve_space",
297+"preflight",
298+"leave",
299+"speak",
300+"test_speech",
301+],
289302},
290303transport: { type: "string", enum: ["chrome", "chrome-node", "twilio"] },
291304mode: { type: "string", enum: ["realtime", "transcribe"] },
@@ -554,6 +567,10 @@ describe("google-meet plugin", () => {
554567action: "start",
555568url: "https://meet.google.com/abc-defg-hij",
556569mode: "transcribe",
570+guestName: "OpenClaw Agent",
571+reuseExistingTab: true,
572+autoJoin: true,
573+waitForInCallMs: 20000,
557574}),
558575}),
559576);
@@ -568,6 +585,81 @@ describe("google-meet plugin", () => {
568585});
569586});
570587588+it("reuses an active Meet session for the same URL and transport", async () => {
589+const { methods, nodesInvoke } = setup(
590+{
591+defaultTransport: "chrome-node",
592+defaultMode: "transcribe",
593+},
594+{
595+nodesInvokeResult: {
596+payload: {
597+launched: true,
598+browser: { inCall: true, micMuted: false },
599+},
600+},
601+},
602+);
603+const handler = methods.get("googlemeet.join") as
604+| ((ctx: {
605+params: Record<string, unknown>;
606+respond: ReturnType<typeof vi.fn>;
607+}) => Promise<void>)
608+| undefined;
609+const first = vi.fn();
610+const second = vi.fn();
611+612+await handler?.({
613+params: { url: "https://meet.google.com/abc-defg-hij" },
614+respond: first,
615+});
616+await handler?.({
617+params: { url: "https://meet.google.com/abc-defg-hij" },
618+respond: second,
619+});
620+621+expect(nodesInvoke).toHaveBeenCalledTimes(1);
622+expect(second.mock.calls[0]?.[1]).toMatchObject({
623+session: {
624+chrome: { health: { inCall: true, micMuted: false } },
625+notes: expect.arrayContaining(["Reused existing active Meet session."]),
626+},
627+});
628+});
629+630+it("exposes a test-speech action that joins the requested meeting", async () => {
631+const { tools, nodesInvoke } = setup(
632+{
633+defaultTransport: "chrome-node",
634+},
635+{
636+nodesInvokeResult: {
637+payload: {
638+launched: true,
639+browser: { inCall: true },
640+},
641+},
642+},
643+);
644+const tool = tools[0] as {
645+execute: (id: string, params: unknown) => Promise<{ details: { createdSession?: boolean } }>;
646+};
647+648+const result = await tool.execute("id", {
649+action: "test_speech",
650+url: "https://meet.google.com/abc-defg-hij",
651+message: "Say exactly: hello.",
652+});
653+654+expect(nodesInvoke).toHaveBeenCalledWith(
655+expect.objectContaining({
656+command: "googlemeet.chrome",
657+params: expect.objectContaining({ action: "start" }),
658+}),
659+);
660+expect(result.details).toMatchObject({ createdSession: true });
661+});
662+571663it("explains when chrome-node has no capable paired node", async () => {
572664const { tools } = setup(
573665{
@@ -781,7 +873,7 @@ describe("google-meet plugin", () => {
781873expect(sendAudio).toHaveBeenCalledWith(Buffer.from([1, 2, 3]));
782874expect(outputStdinWrites).toEqual([Buffer.from([4, 5])]);
783875expect(bridge.acknowledgeMark).toHaveBeenCalled();
784-expect(bridge.triggerGreeting).toHaveBeenCalledWith("Say exactly: I'm here and listening.");
876+expect(bridge.triggerGreeting).not.toHaveBeenCalled();
785877handle.speak("Say exactly: hello from the meeting.");
786878expect(bridge.triggerGreeting).toHaveBeenLastCalledWith("Say exactly: hello from the meeting.");
787879expect(callbacks).toMatchObject({
@@ -922,7 +1014,7 @@ describe("google-meet plugin", () => {
9221014text: "Use the launch update.",
9231015});
9241016});
925-expect(bridge.triggerGreeting).toHaveBeenCalledWith("Say exactly: I'm here and listening.");
1017+expect(bridge.triggerGreeting).not.toHaveBeenCalled();
9261018handle.speak("Say exactly: hello from the node.");
9271019expect(bridge.triggerGreeting).toHaveBeenLastCalledWith("Say exactly: hello from the node.");
9281020expect(callbacks).toMatchObject({
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。