From 65645ec54f504ad4794aaab2cd56559a12b04ed7 Mon Sep 17 00:00:00 2001 From: Ayaan Zaidi Date: Fri, 17 Apr 2026 09:59:03 +0530 Subject: [PATCH] fix(agents): refresh bundle command discovery --- src/agents/skills.test.ts | 23 ++++++++++++++++------- src/plugins/bundle-commands.ts | 1 + 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/agents/skills.test.ts b/src/agents/skills.test.ts index 4eec92a24c3..5b291fc06c0 100644 --- a/src/agents/skills.test.ts +++ b/src/agents/skills.test.ts @@ -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( diff --git a/src/plugins/bundle-commands.ts b/src/plugins/bundle-commands.ts index 134bf984da3..9945d3f0f03 100644 --- a/src/plugins/bundle-commands.ts +++ b/src/plugins/bundle-commands.ts @@ -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[] = [];