From 9694c0611c197130c6df171da140faab830ff0d5 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 26 Apr 2026 10:50:30 +0100 Subject: [PATCH] ci: fix main gate --- pnpm-lock.yaml | 6 ++++ src/cli/run-main.test.ts | 73 +++++++++++++++++++++++++++++++--------- 2 files changed, 64 insertions(+), 15 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 13641f26b8e..8edbe16abed 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -463,6 +463,12 @@ importers: specifier: workspace:* version: link:../../packages/plugin-sdk + extensions/diagnostics-prometheus: + devDependencies: + '@openclaw/plugin-sdk': + specifier: workspace:* + version: link:../../packages/plugin-sdk + extensions/diffs: dependencies: '@pierre/diffs': diff --git a/src/cli/run-main.test.ts b/src/cli/run-main.test.ts index 6265c53b65b..3bab0f30d6b 100644 --- a/src/cli/run-main.test.ts +++ b/src/cli/run-main.test.ts @@ -29,6 +29,25 @@ const memoryWikiCommandAliasRegistry: PluginManifestRegistry = { diagnostics: [], }; +const memoryCoreCommandAliasRegistry: PluginManifestRegistry = { + plugins: [ + { + id: "memory-core", + channels: [], + providers: [], + cliBackends: [], + skills: [], + hooks: [], + origin: "bundled", + rootDir: "/tmp/memory-core", + source: "bundled", + manifestPath: "/tmp/memory-core/openclaw.plugin.json", + commandAliases: [{ name: "dreaming", kind: "runtime-slash", cliCommand: "memory" }], + }, + ], + diagnostics: [], +}; + describe("rewriteUpdateFlagArgv", () => { it("leaves argv unchanged when --update is absent", () => { const argv = ["node", "entry.js", "status"]; @@ -182,7 +201,13 @@ describe("resolveMissingPluginCommandMessage", () => { }); it("explains that dreaming is a runtime slash command, not a CLI command", () => { - const message = resolveMissingPluginCommandMessage("dreaming", {}); + const message = resolveMissingPluginCommandMessage( + "dreaming", + {}, + { + registry: memoryCoreCommandAliasRegistry, + }, + ); expect(message).toContain("runtime slash command"); expect(message).toContain("/dreaming"); expect(message).toContain("memory-core"); @@ -190,36 +215,54 @@ describe("resolveMissingPluginCommandMessage", () => { }); it("returns the runtime command message even when plugins.allow is set", () => { - const message = resolveMissingPluginCommandMessage("dreaming", { - plugins: { - allow: ["memory-core"], + const message = resolveMissingPluginCommandMessage( + "dreaming", + { + plugins: { + allow: ["memory-core"], + }, }, - }); + { + registry: memoryCoreCommandAliasRegistry, + }, + ); expect(message).toContain("runtime slash command"); expect(message).not.toContain("plugins.allow"); }); it("points command names in plugins.allow at their parent plugin", () => { - const message = resolveMissingPluginCommandMessage("dreaming", { - plugins: { - allow: ["dreaming"], + const message = resolveMissingPluginCommandMessage( + "dreaming", + { + plugins: { + allow: ["dreaming"], + }, }, - }); + { + registry: memoryCoreCommandAliasRegistry, + }, + ); expect(message).toContain('"dreaming" is not a plugin'); expect(message).toContain('"memory-core"'); expect(message).toContain("plugins.allow"); }); it("explains parent plugin disablement for runtime command aliases", () => { - const message = resolveMissingPluginCommandMessage("dreaming", { - plugins: { - entries: { - "memory-core": { - enabled: false, + const message = resolveMissingPluginCommandMessage( + "dreaming", + { + plugins: { + entries: { + "memory-core": { + enabled: false, + }, }, }, }, - }); + { + registry: memoryCoreCommandAliasRegistry, + }, + ); expect(message).toContain("plugins.entries.memory-core.enabled=false"); expect(message).not.toContain("runtime slash command"); });