diff --git a/src/commands/agent.e2e.test.ts b/src/commands/agent.e2e.test.ts index 56c24571c4e..eec9287fa54 100644 --- a/src/commands/agent.e2e.test.ts +++ b/src/commands/agent.e2e.test.ts @@ -2,7 +2,6 @@ import fs from "node:fs"; import path from "node:path"; import { beforeEach, describe, expect, it, type MockInstance, vi } from "vitest"; import { telegramPlugin } from "../../extensions/telegram/src/channel.js"; -import "../cron/isolated-agent.mocks.js"; import { setTelegramRuntime } from "../../extensions/telegram/src/runtime.js"; import { withTempHome as withTempHomeBase } from "../../test/helpers/temp-home.js"; import { loadModelCatalog } from "../agents/model-catalog.js"; @@ -16,6 +15,22 @@ import type { RuntimeEnv } from "../runtime.js"; import { createTestRegistry } from "../test-utils/channel-plugins.js"; import { agentCommand } from "./agent.js"; +vi.mock("../agents/pi-embedded.js", () => ({ + runEmbeddedPiAgent: vi.fn(), +})); + +vi.mock("../agents/model-catalog.js", () => ({ + loadModelCatalog: vi.fn(), +})); + +vi.mock("../agents/model-selection.js", async (importOriginal) => { + const actual = await importOriginal(); + return { + ...actual, + isCliProvider: vi.fn(() => false), + }; +}); + const runtime: RuntimeEnv = { log: vi.fn(), error: vi.fn(), diff --git a/src/cron/isolated-agent.mocks.ts b/src/cron/isolated-agent.mocks.ts index 2939f2e3bc8..2eb92bc8daa 100644 --- a/src/cron/isolated-agent.mocks.ts +++ b/src/cron/isolated-agent.mocks.ts @@ -10,6 +10,14 @@ vi.mock("../agents/model-catalog.js", () => ({ loadModelCatalog: vi.fn(), })); +vi.mock("../agents/model-selection.js", async (importOriginal) => { + const actual = await importOriginal(); + return { + ...actual, + isCliProvider: vi.fn(() => false), + }; +}); + vi.mock("../agents/subagent-announce.js", () => ({ runSubagentAnnounceFlow: vi.fn(), }));