test: fix latest main test regressions

This commit is contained in:
Peter Steinberger
2026-03-22 18:27:35 -07:00
parent 774a2064c9
commit ecdf5d457a
7 changed files with 50 additions and 15 deletions

View File

@@ -31,7 +31,14 @@ const DIR_ID_EXCEPTIONS = new Map<string, string>([
// Historical directory name kept until a wider repo cleanup is worth the churn.
["kimi-coding", "kimi"],
]);
const ALLOWED_PACKAGE_SUFFIXES = ["", "-provider", "-plugin", "-speech", "-sandbox"] as const;
const ALLOWED_PACKAGE_SUFFIXES = [
"",
"-provider",
"-plugin",
"-speech",
"-sandbox",
"-media-understanding",
] as const;
function readJsonFile<T>(filePath: string): T {
return JSON.parse(fs.readFileSync(filePath, "utf8")) as T;

View File

@@ -1,9 +1,14 @@
import { completeSimple, type AssistantMessage } from "@mariozechner/pi-ai";
import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import { buildElevenLabsSpeechProvider } from "../../extensions/elevenlabs/speech-provider.ts";
import { buildMicrosoftSpeechProvider } from "../../extensions/microsoft/speech-provider.ts";
import { buildOpenAISpeechProvider } from "../../extensions/openai/speech-provider.ts";
import { ensureCustomApiRegistered } from "../agents/custom-api-registry.js";
import { getApiKeyForModel } from "../agents/model-auth.js";
import { resolveModelAsync } from "../agents/pi-embedded-runner/model.js";
import type { OpenClawConfig } from "../config/config.js";
import { createEmptyPluginRegistry } from "../plugins/registry-empty.js";
import { setActivePluginRegistry } from "../plugins/runtime.js";
import { withEnv } from "../test-utils/env.js";
import * as tts from "./tts.js";
@@ -124,6 +129,13 @@ function createOpenAiTelephonyCfg(model: "tts-1" | "gpt-4o-mini-tts"): OpenClawC
describe("tts", () => {
beforeEach(() => {
const registry = createEmptyPluginRegistry();
registry.speechProviders = [
{ pluginId: "openai", provider: buildOpenAISpeechProvider(), source: "test" },
{ pluginId: "microsoft", provider: buildMicrosoftSpeechProvider(), source: "test" },
{ pluginId: "elevenlabs", provider: buildElevenLabsSpeechProvider(), source: "test" },
];
setActivePluginRegistry(registry, "tts-test");
vi.clearAllMocks();
vi.mocked(completeSimple).mockResolvedValue(
mockAssistantMessage([{ type: "text", text: "Summary" }]),