fix(google-meet): expose voice call delay schema

This commit is contained in:
Vincent Koc
2026-05-03 20:16:50 -07:00
parent 9cc802241c
commit c52b5657a2
3 changed files with 29 additions and 7 deletions

View File

@@ -4,6 +4,7 @@ import { tmpdir } from "node:os";
import path from "node:path";
import { PassThrough, Writable } from "node:stream";
import { createContext, Script } from "node:vm";
import { validateJsonSchemaValue, type JsonSchemaObject } from "openclaw/plugin-sdk/config-schema";
import type { RealtimeTranscriptionProviderPlugin } from "openclaw/plugin-sdk/realtime-transcription";
import type { RealtimeVoiceProviderPlugin } from "openclaw/plugin-sdk/realtime-voice";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
@@ -479,17 +480,13 @@ describe("google-meet plugin", () => {
});
});
it("declares barge-in config metadata in the plugin entry and manifest", () => {
it("declares advanced config metadata in the plugin entry and manifest", () => {
const manifest = JSON.parse(
readFileSync(new URL("./openclaw.plugin.json", import.meta.url), "utf8"),
) as {
uiHints?: Record<string, unknown>;
configSchema?: {
properties?: {
chrome?: {
properties?: Record<string, unknown>;
};
};
configSchema?: JsonSchemaObject & {
properties?: Record<string, JsonSchemaObject & { properties?: Record<string, unknown> }>;
};
};
const entry = plugin as unknown as {
@@ -504,6 +501,7 @@ describe("google-meet plugin", () => {
"chrome.bargeInRmsThreshold": expect.objectContaining({ advanced: true }),
"chrome.bargeInPeakThreshold": expect.objectContaining({ advanced: true }),
"chrome.bargeInCooldownMs": expect.objectContaining({ advanced: true }),
"voiceCall.postDtmfSpeechDelayMs": expect.objectContaining({ advanced: true }),
});
expect(manifest.uiHints).toMatchObject({
"chrome.audioBufferBytes": expect.objectContaining({ advanced: true }),
@@ -511,6 +509,7 @@ describe("google-meet plugin", () => {
"chrome.bargeInRmsThreshold": expect.objectContaining({ advanced: true }),
"chrome.bargeInPeakThreshold": expect.objectContaining({ advanced: true }),
"chrome.bargeInCooldownMs": expect.objectContaining({ advanced: true }),
"voiceCall.postDtmfSpeechDelayMs": expect.objectContaining({ advanced: true }),
});
expect(manifest.configSchema?.properties?.chrome?.properties).toMatchObject({
audioBufferBytes: expect.objectContaining({ type: "number", default: 4096 }),
@@ -522,6 +521,19 @@ describe("google-meet plugin", () => {
bargeInPeakThreshold: expect.objectContaining({ type: "number", default: 2500 }),
bargeInCooldownMs: expect.objectContaining({ type: "number", default: 900 }),
});
expect(manifest.configSchema?.properties?.voiceCall?.properties).toMatchObject({
postDtmfSpeechDelayMs: expect.objectContaining({ type: "number", default: 5000 }),
});
const result = validateJsonSchemaValue({
schema: manifest.configSchema!,
cacheKey: "google-meet.manifest.voice-call-post-dtmf-speech-delay",
value: {
voiceCall: {
postDtmfSpeechDelayMs: 750,
},
},
});
expect(result.ok).toBe(true);
});
it("resolves the realtime consult agent id", () => {

View File

@@ -144,6 +144,11 @@
"help": "Compatibility setting from the old post-connect DTMF flow. Twilio Meet joins now play DTMF before realtime connect.",
"advanced": true
},
"voiceCall.postDtmfSpeechDelayMs": {
"label": "Legacy Post-DTMF Speech Delay (ms)",
"help": "Compatibility setting from the old delayed-speech flow. Twilio Meet joins now carry the intro as the initial Voice Call message.",
"advanced": true
},
"voiceCall.introMessage": {
"label": "Voice Call Intro Message",
"advanced": true
@@ -421,6 +426,10 @@
"type": "number",
"default": 2500
},
"postDtmfSpeechDelayMs": {
"type": "number",
"default": 5000
},
"introMessage": {
"type": "string"
}