perf(test): reduce skills + update + memory suite overhead
This commit is contained in:
@@ -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 };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user