mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 12:10:42 +00:00
fix: keep provider index previews authoritative
This commit is contained in:
@@ -740,7 +740,11 @@ Catalog authority order:
|
||||
4. OpenClaw Provider Index preview rows.
|
||||
|
||||
The Provider Index must not contain secrets, enabled state, runtime hooks, or
|
||||
live account-specific model data. Providers with live `/models` discovery should
|
||||
live account-specific model data. Its preview catalogs use the same
|
||||
`modelCatalog` provider row shape as plugin manifests, but should stay limited
|
||||
to stable display metadata unless runtime adapter fields such as `api`,
|
||||
`baseUrl`, pricing, or compatibility flags are intentionally kept aligned with
|
||||
the installed plugin manifest. Providers with live `/models` discovery should
|
||||
write refreshed rows through the explicit model catalog cache path instead of
|
||||
making normal listing or onboarding call provider APIs.
|
||||
|
||||
|
||||
@@ -99,6 +99,8 @@ describe("OpenClaw provider index", () => {
|
||||
it("loads the bundled provider index without runtime plugin loading", () => {
|
||||
const index = loadOpenClawProviderIndex();
|
||||
|
||||
expect(index.providers.moonshot?.previewCatalog).not.toHaveProperty("api");
|
||||
expect(index.providers.moonshot?.previewCatalog).not.toHaveProperty("baseUrl");
|
||||
expect(index.providers.moonshot?.previewCatalog?.models).toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
@@ -108,5 +110,13 @@ describe("OpenClaw provider index", () => {
|
||||
]),
|
||||
);
|
||||
expect(index.providers.deepseek?.plugin.id).toBe("deepseek");
|
||||
expect(index.providers.deepseek?.previewCatalog?.models).toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
id: "deepseek-chat",
|
||||
contextWindow: 131072,
|
||||
}),
|
||||
]),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -3,6 +3,9 @@ import type { OpenClawProviderIndex } from "./types.js";
|
||||
// OpenClaw-owned preview metadata for providers whose plugins may not be
|
||||
// installed yet. Installed plugin manifests remain authoritative; this index is
|
||||
// a fallback for installable-provider and pre-install model picker surfaces.
|
||||
// Preview catalogs use the shared model catalog type, but intentionally keep to
|
||||
// stable display fields unless runtime adapter metadata is kept in sync with
|
||||
// the installed plugin manifest.
|
||||
export const OPENCLAW_PROVIDER_INDEX = {
|
||||
version: 1,
|
||||
providers: {
|
||||
@@ -15,8 +18,6 @@ export const OPENCLAW_PROVIDER_INDEX = {
|
||||
docs: "/providers/moonshot",
|
||||
categories: ["cloud", "llm"],
|
||||
previewCatalog: {
|
||||
api: "openai-responses",
|
||||
baseUrl: "https://api.moonshot.ai/v1",
|
||||
models: [
|
||||
{
|
||||
id: "kimi-k2.6",
|
||||
@@ -36,21 +37,19 @@ export const OPENCLAW_PROVIDER_INDEX = {
|
||||
docs: "/providers/deepseek",
|
||||
categories: ["cloud", "llm"],
|
||||
previewCatalog: {
|
||||
api: "openai-responses",
|
||||
baseUrl: "https://api.deepseek.com/v1",
|
||||
models: [
|
||||
{
|
||||
id: "deepseek-chat",
|
||||
name: "DeepSeek Chat",
|
||||
input: ["text"],
|
||||
contextWindow: 64000,
|
||||
contextWindow: 131072,
|
||||
},
|
||||
{
|
||||
id: "deepseek-reasoner",
|
||||
name: "DeepSeek Reasoner",
|
||||
input: ["text"],
|
||||
reasoning: true,
|
||||
contextWindow: 64000,
|
||||
contextWindow: 131072,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user