fix(ci): restore channel typing and root-help metadata build

This commit is contained in:
Peter Steinberger
2026-04-04 07:58:53 +01:00
parent 7b4e20fc8c
commit 406a47284a
4 changed files with 144 additions and 28 deletions

View File

@@ -1,6 +1,16 @@
import { describe, expect, it, vi } from "vitest";
import { renderRootHelpText } from "./root-help.js";
const getPluginCliCommandDescriptorsMock = vi.fn(
async (_config?: unknown, _env?: unknown, _loaderOptions?: unknown) => [
{
name: "matrix",
description: "Matrix channel utilities",
hasSubcommands: true,
},
],
);
vi.mock("./core-command-descriptors.js", () => ({
getCoreCliCommandDescriptors: () => [
{
@@ -24,16 +34,28 @@ vi.mock("./subcli-descriptors.js", () => ({
}));
vi.mock("../../plugins/cli.js", () => ({
getPluginCliCommandDescriptors: async () => [
{
name: "matrix",
description: "Matrix channel utilities",
hasSubcommands: true,
},
],
getPluginCliCommandDescriptors: (...args: [unknown?, unknown?, unknown?]) =>
getPluginCliCommandDescriptorsMock(...args),
}));
describe("root help", () => {
it("passes isolated config and env through to plugin CLI descriptor loading", async () => {
const config = {
agents: {
defaults: {
workspace: "/tmp/openclaw-root-help-workspace",
},
},
};
const env = { OPENCLAW_STATE_DIR: "/tmp/openclaw-root-help-state" } as NodeJS.ProcessEnv;
await renderRootHelpText({ config, env, pluginSdkResolution: "src" });
expect(getPluginCliCommandDescriptorsMock).toHaveBeenCalledWith(config, env, {
pluginSdkResolution: "src",
});
});
it("includes plugin CLI descriptors alongside core and sub-CLI commands", async () => {
const text = await renderRootHelpText();