fix(plugins): fail strict bootstrap on plugin load errors

This commit is contained in:
Vincent Koc
2026-03-19 16:04:19 -07:00
parent 009f494cd9
commit f3971571fe
4 changed files with 68 additions and 2 deletions

View File

@@ -60,6 +60,7 @@ describe("ensurePluginRegistryLoaded", () => {
expect(mocks.loadOpenClawPlugins).toHaveBeenCalledWith(
expect.objectContaining({
onlyPluginIds: [],
throwOnLoadError: true,
}),
);
});
@@ -85,11 +86,14 @@ describe("ensurePluginRegistryLoaded", () => {
expect(mocks.loadOpenClawPlugins).toHaveBeenCalledTimes(2);
expect(mocks.loadOpenClawPlugins).toHaveBeenNthCalledWith(
1,
expect.objectContaining({ onlyPluginIds: [] }),
expect.objectContaining({ onlyPluginIds: [], throwOnLoadError: true }),
);
expect(mocks.loadOpenClawPlugins).toHaveBeenNthCalledWith(
2,
expect.objectContaining({ onlyPluginIds: ["telegram", "slack"] }),
expect.objectContaining({
onlyPluginIds: ["telegram", "slack"],
throwOnLoadError: true,
}),
);
});
});

View File

@@ -55,6 +55,7 @@ export function ensurePluginRegistryLoaded(options?: { scope?: PluginRegistrySco
config,
workspaceDir,
logger,
throwOnLoadError: true,
...(scope === "configured-channels"
? {
onlyPluginIds: resolveConfiguredChannelPluginIds({