mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 03:18:26 +00:00
Plugins/Hooks: avoid duplicate before_agent_start executions
This commit is contained in:
@@ -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 () => {}),
|
||||
|
||||
Reference in New Issue
Block a user