perf(test): reduce skills + update + memory suite overhead

This commit is contained in:
Peter Steinberger
2026-02-14 15:36:04 +00:00
parent 684c18458a
commit 76e4e9d176
6 changed files with 90 additions and 43 deletions

View File

@@ -4,6 +4,7 @@ import { resolveBundledSkillsDir, type BundledSkillsResolveOptions } from "./bun
const skillsLogger = createSubsystemLogger("skills");
let hasWarnedMissingBundledDir = false;
let cachedBundledContext: { dir: string; names: Set<string> } | null = null;
export type BundledSkillsContext = {
dir?: string;
@@ -24,11 +25,16 @@ export function resolveBundledSkillsContext(
}
return { dir, names };
}
if (cachedBundledContext?.dir === dir) {
return { dir, names: new Set(cachedBundledContext.names) };
}
const result = loadSkillsFromDir({ dir, source: "openclaw-bundled" });
for (const skill of result.skills) {
if (skill.name.trim()) {
names.add(skill.name);
}
}
cachedBundledContext = { dir, names: new Set(names) };
return { dir, names };
}