fix: use static provider catalogs for model listing

This commit is contained in:
Shakker
2026-04-22 02:36:18 +01:00
committed by Shakker
parent 651d5e0022
commit 04ecf284fc
16 changed files with 219 additions and 25 deletions

View File

@@ -2,8 +2,15 @@ import { describe, expect, it, vi } from "vitest";
import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-registration.js";
import { expectPassthroughReplayPolicy } from "../../test/helpers/provider-replay-policy.ts";
import openrouterPlugin from "./index.js";
import { buildOpenrouterProvider } from "./provider-catalog.js";
describe("openrouter provider hooks", () => {
it("includes Kimi K2.6 in the bundled catalog", () => {
expect(buildOpenrouterProvider().models?.map((model) => model.id)).toContain(
"moonshotai/kimi-k2.6",
);
});
it("owns passthrough-gemini replay policy for Gemini-backed models", async () => {
await expectPassthroughReplayPolicy({
plugin: openrouterPlugin,

View File

@@ -110,6 +110,12 @@ export default definePluginEntry({
};
},
},
staticCatalog: {
order: "simple",
run: async () => ({
provider: buildOpenrouterProvider(),
}),
},
resolveDynamicModel: (ctx) => buildDynamicOpenRouterModel(ctx),
prepareDynamicModel: async (ctx) => {
await loadOpenRouterModelCapabilities(ctx.modelId);