mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 08:20:43 +00:00
fix: preserve manifest fallback for derived provider indexes
This commit is contained in:
@@ -210,6 +210,30 @@ describe("loadProviderCatalogModelsForList", () => {
|
||||
expect(providerDiscoveryMocks.resolveOwningPluginIdsForProvider).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("falls back to manifest ownership when the plugin index is derived", async () => {
|
||||
providerDiscoveryMocks.loadPluginRegistrySnapshotWithMetadata.mockReturnValueOnce({
|
||||
source: "derived",
|
||||
snapshot: {
|
||||
plugins: [],
|
||||
},
|
||||
diagnostics: [],
|
||||
});
|
||||
|
||||
await expect(
|
||||
resolveProviderCatalogPluginIdsForFilter({
|
||||
cfg: baseParams.cfg,
|
||||
env: baseParams.env,
|
||||
providerFilter: "moonshot",
|
||||
}),
|
||||
).resolves.toEqual(["moonshot"]);
|
||||
|
||||
expect(providerDiscoveryMocks.resolveOwningPluginIdsForProvider).toHaveBeenCalledWith({
|
||||
provider: "moonshot",
|
||||
config: baseParams.cfg,
|
||||
env: baseParams.env,
|
||||
});
|
||||
});
|
||||
|
||||
it("does not fall back to legacy manifest ownership for disabled persisted plugin owners", async () => {
|
||||
providerDiscoveryMocks.resolveProviderOwners
|
||||
.mockReturnValueOnce([])
|
||||
|
||||
@@ -76,7 +76,7 @@ function resolveInstalledIndexPluginIdsForProviderFilter(params: {
|
||||
cache: true,
|
||||
});
|
||||
if (snapshot.source !== "persisted" && snapshot.source !== "provided") {
|
||||
return [];
|
||||
return undefined;
|
||||
}
|
||||
const index = snapshot.snapshot;
|
||||
const pluginIds = [
|
||||
|
||||
Reference in New Issue
Block a user