fix(agents): refresh bundle command discovery

This commit is contained in:
Ayaan Zaidi
2026-04-17 09:59:03 +05:30
parent e8ae3901b6
commit 65645ec54f
2 changed files with 17 additions and 7 deletions

View File

@@ -213,6 +213,21 @@ describe("buildWorkspaceSkillCommandSpecs", () => {
it("includes enabled Claude bundle markdown commands as native OpenClaw slash commands", async () => {
const workspaceDir = await makeWorkspace();
const config = {
plugins: {
entries: {
"compound-bundle": { enabled: true },
},
},
} satisfies OpenClawConfig;
// Prime plugin discovery before the bundle exists so command loading proves
// it sees the current filesystem state instead of a stale cached snapshot.
buildWorkspaceSkillCommandSpecs(workspaceDir, {
...resolveTestSkillDirs(workspaceDir),
config,
});
const pluginRoot = path.join(tempHome!.home, ".openclaw", "extensions", "compound-bundle");
await fs.mkdir(path.join(pluginRoot, ".claude-plugin"), { recursive: true });
await fs.mkdir(path.join(pluginRoot, "commands"), { recursive: true });
@@ -236,13 +251,7 @@ describe("buildWorkspaceSkillCommandSpecs", () => {
const commands = buildWorkspaceSkillCommandSpecs(workspaceDir, {
...resolveTestSkillDirs(workspaceDir),
config: {
plugins: {
entries: {
"compound-bundle": { enabled: true },
},
},
},
config,
});
expect(commands).toEqual(

View File

@@ -172,6 +172,7 @@ export function loadEnabledClaudeBundleCommands(params: {
const registry = loadPluginManifestRegistry({
workspaceDir: params.workspaceDir,
config: params.cfg,
cache: false,
});
const normalizedPlugins = normalizePluginsConfig(params.cfg?.plugins);
const commands: ClaudeBundleCommandSpec[] = [];