mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-21 23:11:01 +00:00
Doctor: add bundle plugin capability summary to workspace status
This commit is contained in:
@@ -98,6 +98,75 @@ describe("noteWorkspaceStatus", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("surfaces bundle plugin capabilities in the plugins note", async () => {
|
||||
resolveDefaultAgentIdMock.mockReturnValue("default");
|
||||
resolveAgentWorkspaceDirMock.mockReturnValue("/workspace");
|
||||
buildWorkspaceSkillStatusMock.mockReturnValue({
|
||||
skills: [],
|
||||
});
|
||||
loadOpenClawPluginsMock.mockReturnValue({
|
||||
plugins: [
|
||||
{
|
||||
id: "claude-bundle",
|
||||
name: "Claude Bundle",
|
||||
source: "/tmp/claude-bundle",
|
||||
origin: "workspace",
|
||||
enabled: true,
|
||||
status: "loaded",
|
||||
format: "bundle",
|
||||
bundleFormat: "claude",
|
||||
bundleCapabilities: ["skills", "commands", "agents"],
|
||||
toolNames: [],
|
||||
hookNames: [],
|
||||
channelIds: [],
|
||||
providerIds: [],
|
||||
speechProviderIds: [],
|
||||
mediaUnderstandingProviderIds: [],
|
||||
imageGenerationProviderIds: [],
|
||||
webSearchProviderIds: [],
|
||||
gatewayMethods: [],
|
||||
cliCommands: [],
|
||||
services: [],
|
||||
commands: [],
|
||||
httpRoutes: 0,
|
||||
hookCount: 0,
|
||||
configSchema: false,
|
||||
},
|
||||
],
|
||||
diagnostics: [],
|
||||
channels: [],
|
||||
channelSetups: [],
|
||||
providers: [],
|
||||
speechProviders: [],
|
||||
mediaUnderstandingProviders: [],
|
||||
imageGenerationProviders: [],
|
||||
webSearchProviders: [],
|
||||
tools: [],
|
||||
hooks: [],
|
||||
typedHooks: [],
|
||||
httpRoutes: [],
|
||||
gatewayHandlers: {},
|
||||
cliRegistrars: [],
|
||||
services: [],
|
||||
commands: [],
|
||||
conversationBindingResolvedHandlers: [],
|
||||
});
|
||||
|
||||
const noteSpy = vi.spyOn(noteModule, "note").mockImplementation(() => {});
|
||||
try {
|
||||
const { noteWorkspaceStatus } = await import("./doctor-workspace-status.js");
|
||||
noteWorkspaceStatus({});
|
||||
|
||||
const pluginCalls = noteSpy.mock.calls.filter(([, title]) => title === "Plugins");
|
||||
expect(pluginCalls).toHaveLength(1);
|
||||
const body = String(pluginCalls[0]?.[0]);
|
||||
expect(body).toContain("Bundle plugins: 1");
|
||||
expect(body).toContain("agents, commands, skills");
|
||||
} finally {
|
||||
noteSpy.mockRestore();
|
||||
}
|
||||
});
|
||||
|
||||
it("omits plugin compatibility note when no legacy compatibility paths are present", async () => {
|
||||
resolveDefaultAgentIdMock.mockReturnValue("default");
|
||||
resolveAgentWorkspaceDirMock.mockReturnValue("/workspace");
|
||||
|
||||
@@ -53,6 +53,14 @@ export function noteWorkspaceStatus(cfg: OpenClawConfig) {
|
||||
: null,
|
||||
].filter((line): line is string => Boolean(line));
|
||||
|
||||
const bundlePlugins = loaded.filter(
|
||||
(p) => p.format === "bundle" && (p.bundleCapabilities?.length ?? 0) > 0,
|
||||
);
|
||||
if (bundlePlugins.length > 0) {
|
||||
const allCaps = new Set(bundlePlugins.flatMap((p) => p.bundleCapabilities ?? []));
|
||||
lines.push(`Bundle plugins: ${bundlePlugins.length} (${[...allCaps].toSorted().join(", ")})`);
|
||||
}
|
||||
|
||||
note(lines.join("\n"), "Plugins");
|
||||
}
|
||||
const compatibilityWarnings = buildPluginCompatibilityWarnings({
|
||||
|
||||
Reference in New Issue
Block a user