mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-15 19:21:08 +00:00
feat(plugins): surface imported runtime state in status tooling (#59659)
* feat(plugins): surface imported runtime state * fix(plugins): keep status imports snapshot-only * fix(plugins): keep status snapshots manifest-only * fix(plugins): restore doctor load checks * refactor(plugins): split snapshot and diagnostics reports * fix(plugins): track imported erroring modules * fix(plugins): keep hot metadata where required * fix(plugins): keep hot doctor and write targeting * fix(plugins): track throwing module imports
This commit is contained in:
@@ -5,7 +5,9 @@ import {
|
||||
getActivePluginHttpRouteRegistryVersion,
|
||||
getActivePluginRegistryVersion,
|
||||
getActivePluginRegistry,
|
||||
listImportedRuntimePluginIds,
|
||||
pinActivePluginHttpRouteRegistry,
|
||||
recordImportedPluginId,
|
||||
releasePinnedPluginHttpRouteRegistry,
|
||||
resetPluginRuntimeStateForTest,
|
||||
resolveActivePluginHttpRouteRegistry,
|
||||
@@ -180,6 +182,72 @@ describe("setActivePluginRegistry", () => {
|
||||
setActivePluginRegistry(registry);
|
||||
expect(getActivePluginRegistry()?.httpRoutes).toHaveLength(1);
|
||||
});
|
||||
|
||||
it("does not treat bundle-only loaded entries as imported runtime plugins", () => {
|
||||
const registry = createEmptyPluginRegistry();
|
||||
registry.plugins.push({
|
||||
id: "bundle-only",
|
||||
name: "Bundle Only",
|
||||
source: "/tmp/bundle",
|
||||
origin: "bundled",
|
||||
enabled: true,
|
||||
status: "loaded",
|
||||
format: "bundle",
|
||||
toolNames: [],
|
||||
hookNames: [],
|
||||
channelIds: [],
|
||||
cliBackendIds: [],
|
||||
providerIds: [],
|
||||
speechProviderIds: [],
|
||||
mediaUnderstandingProviderIds: [],
|
||||
imageGenerationProviderIds: [],
|
||||
webFetchProviderIds: [],
|
||||
webSearchProviderIds: [],
|
||||
gatewayMethods: [],
|
||||
cliCommands: [],
|
||||
services: [],
|
||||
commands: [],
|
||||
httpRoutes: 0,
|
||||
hookCount: 0,
|
||||
configSchema: true,
|
||||
});
|
||||
registry.plugins.push({
|
||||
id: "runtime-plugin",
|
||||
name: "Runtime Plugin",
|
||||
source: "/tmp/runtime",
|
||||
origin: "workspace",
|
||||
enabled: true,
|
||||
status: "loaded",
|
||||
format: "openclaw",
|
||||
toolNames: [],
|
||||
hookNames: [],
|
||||
channelIds: [],
|
||||
cliBackendIds: [],
|
||||
providerIds: [],
|
||||
speechProviderIds: [],
|
||||
mediaUnderstandingProviderIds: [],
|
||||
imageGenerationProviderIds: [],
|
||||
webFetchProviderIds: [],
|
||||
webSearchProviderIds: [],
|
||||
gatewayMethods: [],
|
||||
cliCommands: [],
|
||||
services: [],
|
||||
commands: [],
|
||||
httpRoutes: 0,
|
||||
hookCount: 0,
|
||||
configSchema: true,
|
||||
});
|
||||
|
||||
setActivePluginRegistry(registry);
|
||||
|
||||
expect(listImportedRuntimePluginIds()).toEqual(["runtime-plugin"]);
|
||||
});
|
||||
|
||||
it("includes plugin ids imported before registration failed", () => {
|
||||
recordImportedPluginId("broken-plugin");
|
||||
|
||||
expect(listImportedRuntimePluginIds()).toEqual(["broken-plugin"]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("setActivePluginRegistry", () => {
|
||||
|
||||
Reference in New Issue
Block a user