Plugins/Hooks: avoid duplicate before_agent_start executions

This commit is contained in:
Vignesh Natarajan
2026-02-21 22:31:51 -08:00
parent 96c985400d
commit 542fc169d2
7 changed files with 174 additions and 41 deletions

View File

@@ -1,5 +1,16 @@
import { vi } from "vitest";
export const mockedGlobalHookRunner = {
hasHooks: vi.fn(() => false),
runBeforeAgentStart: vi.fn(async () => undefined),
runBeforePromptBuild: vi.fn(async () => undefined),
runBeforeModelResolve: vi.fn(async () => undefined),
};
vi.mock("../../plugins/hook-runner-global.js", () => ({
getGlobalHookRunner: vi.fn(() => mockedGlobalHookRunner),
}));
vi.mock("../auth-profiles.js", () => ({
isProfileInCooldown: vi.fn(() => false),
markAuthProfileFailure: vi.fn(async () => {}),