ci: fix main gate

This commit is contained in:
Peter Steinberger
2026-04-26 10:50:30 +01:00
parent 4b2056fcc1
commit 9694c0611c
2 changed files with 64 additions and 15 deletions

6
pnpm-lock.yaml generated
View File

@@ -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':

View File

@@ -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");
});