mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 14:40:43 +00:00
fix: use static provider catalogs for model listing
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user