From 85ef6d248dffaff8b68593776265eaa59bc5ebb5 Mon Sep 17 00:00:00 2001 From: Shakker Date: Sat, 9 May 2026 17:48:32 +0100 Subject: [PATCH] test: mock tts in system prompt wrappers --- src/agents/cli-runner/helpers.system-prompt.test.ts | 6 +++++- src/agents/pi-embedded-runner/system-prompt.test.ts | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/agents/cli-runner/helpers.system-prompt.test.ts b/src/agents/cli-runner/helpers.system-prompt.test.ts index 1fef66134b1..70e77337738 100644 --- a/src/agents/cli-runner/helpers.system-prompt.test.ts +++ b/src/agents/cli-runner/helpers.system-prompt.test.ts @@ -1,6 +1,10 @@ -import { describe, expect, it } from "vitest"; +import { describe, expect, it, vi } from "vitest"; import { buildCliAgentSystemPrompt } from "./helpers.js"; +vi.mock("../../tts/tts.js", () => ({ + buildTtsSystemPromptHint: vi.fn(() => undefined), +})); + describe("buildCliAgentSystemPrompt", () => { it("uses config-backed sub-agent delegation mode", () => { const prompt = buildCliAgentSystemPrompt({ diff --git a/src/agents/pi-embedded-runner/system-prompt.test.ts b/src/agents/pi-embedded-runner/system-prompt.test.ts index 3a11ffbab4d..07b513db4c8 100644 --- a/src/agents/pi-embedded-runner/system-prompt.test.ts +++ b/src/agents/pi-embedded-runner/system-prompt.test.ts @@ -1,5 +1,5 @@ import type { AgentSession } from "@mariozechner/pi-coding-agent"; -import { afterEach, describe, expect, it } from "vitest"; +import { afterEach, describe, expect, it, vi } from "vitest"; import { clearMemoryPluginState, registerMemoryPromptSection } from "../../plugins/memory-state.js"; import { applySystemPromptOverrideToSession, @@ -7,6 +7,10 @@ import { createSystemPromptOverride, } from "./system-prompt.js"; +vi.mock("../../tts/tts.js", () => ({ + buildTtsSystemPromptHint: vi.fn(() => undefined), +})); + type MutableSession = { _baseSystemPrompt?: string; _rebuildSystemPrompt?: (toolNames: string[]) => string;