mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 21:01:26 +00:00
perf(test): replace module resets with direct spies and runtime seams
This commit is contained in:
@@ -36,6 +36,10 @@ import { loadWorkspaceHookEntries } from "./workspace.js";
|
||||
export async function loadInternalHooks(
|
||||
cfg: OpenClawConfig,
|
||||
workspaceDir: string,
|
||||
opts?: {
|
||||
managedHooksDir?: string;
|
||||
bundledHooksDir?: string;
|
||||
},
|
||||
): Promise<number> {
|
||||
// Check if hooks are enabled
|
||||
if (!cfg.hooks?.internal?.enabled) {
|
||||
@@ -46,7 +50,11 @@ export async function loadInternalHooks(
|
||||
|
||||
// 1. Load hooks from directories (new system)
|
||||
try {
|
||||
const hookEntries = loadWorkspaceHookEntries(workspaceDir, { config: cfg });
|
||||
const hookEntries = loadWorkspaceHookEntries(workspaceDir, {
|
||||
config: cfg,
|
||||
managedHooksDir: opts?.managedHooksDir,
|
||||
bundledHooksDir: opts?.bundledHooksDir,
|
||||
});
|
||||
|
||||
// Filter by eligibility
|
||||
const eligible = hookEntries.filter((entry) => shouldIncludeHook({ entry, config: cfg }));
|
||||
|
||||
Reference in New Issue
Block a user