mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-28 13:26:04 -06:00
fix(cli): omit unobserved plugin harness ids (#112235)
This commit is contained in:
@@ -45,7 +45,14 @@ describe("runPluginsListCommand", () => {
|
||||
workspaceDir: "/workspace",
|
||||
registrySource: "config",
|
||||
registryDiagnostics: [],
|
||||
plugins: [{ id: "demo", enabled: true }],
|
||||
plugins: [
|
||||
{
|
||||
id: "demo",
|
||||
enabled: true,
|
||||
commands: ["demo"],
|
||||
agentHarnessIds: ["runtime-only"],
|
||||
},
|
||||
],
|
||||
diagnostics: [],
|
||||
}),
|
||||
}));
|
||||
@@ -102,7 +109,7 @@ describe("runPluginsListCommand", () => {
|
||||
source: "config",
|
||||
diagnostics: [],
|
||||
},
|
||||
plugins: [{ id: "demo", enabled: true }],
|
||||
plugins: [{ id: "demo", enabled: true, commands: ["demo"] }],
|
||||
diagnostics: [],
|
||||
},
|
||||
]);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// `openclaw plugins list`: builds registry reports and defers terminal-only formatting modules.
|
||||
import { getRuntimeConfig } from "../config/config.js";
|
||||
import type { PluginRecord } from "../plugins/registry.js";
|
||||
import { defaultRuntime, writeRuntimeJson, type RuntimeEnv } from "../runtime.js";
|
||||
import { quietPluginJsonLogger } from "./plugins-json-logger.js";
|
||||
|
||||
@@ -10,6 +11,13 @@ export type PluginsListOptions = {
|
||||
verbose?: boolean;
|
||||
};
|
||||
|
||||
function toPluginListJsonRecord(plugin: PluginRecord): Omit<PluginRecord, "agentHarnessIds"> {
|
||||
// Snapshot listing never imports plugin runtimes, so it cannot observe harness registrations.
|
||||
// Omit the field instead of serializing the registry-compatible empty placeholder.
|
||||
const { agentHarnessIds: _agentHarnessIds, ...record } = plugin;
|
||||
return record;
|
||||
}
|
||||
|
||||
async function loadHumanListModules() {
|
||||
const [sourceDisplay, table, themeModule, commandFormat, listFormat] = await Promise.all([
|
||||
import("../plugins/source-display.js"),
|
||||
@@ -50,7 +58,7 @@ export async function runPluginsListCommand(
|
||||
source: report.registrySource,
|
||||
diagnostics: report.registryDiagnostics,
|
||||
},
|
||||
plugins: list,
|
||||
plugins: list.map(toPluginListJsonRecord),
|
||||
diagnostics: report.diagnostics,
|
||||
};
|
||||
writeRuntimeJson(runtime, payload);
|
||||
|
||||
Reference in New Issue
Block a user