fix: keep provider index previews authoritative · openclaw/openclaw@e827778
shakkernerd
·
2026-04-26
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -740,7 +740,11 @@ Catalog authority order:
|
740 | 740 | 4. OpenClaw Provider Index preview rows. |
741 | 741 | |
742 | 742 | The Provider Index must not contain secrets, enabled state, runtime hooks, or |
743 | | -live account-specific model data. Providers with live `/models` discovery should |
| 743 | +live account-specific model data. Its preview catalogs use the same |
| 744 | +`modelCatalog` provider row shape as plugin manifests, but should stay limited |
| 745 | +to stable display metadata unless runtime adapter fields such as `api`, |
| 746 | +`baseUrl`, pricing, or compatibility flags are intentionally kept aligned with |
| 747 | +the installed plugin manifest. Providers with live `/models` discovery should |
744 | 748 | write refreshed rows through the explicit model catalog cache path instead of |
745 | 749 | making normal listing or onboarding call provider APIs. |
746 | 750 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -99,6 +99,8 @@ describe("OpenClaw provider index", () => {
|
99 | 99 | it("loads the bundled provider index without runtime plugin loading", () => { |
100 | 100 | const index = loadOpenClawProviderIndex(); |
101 | 101 | |
| 102 | +expect(index.providers.moonshot?.previewCatalog).not.toHaveProperty("api"); |
| 103 | +expect(index.providers.moonshot?.previewCatalog).not.toHaveProperty("baseUrl"); |
102 | 104 | expect(index.providers.moonshot?.previewCatalog?.models).toEqual( |
103 | 105 | expect.arrayContaining([ |
104 | 106 | expect.objectContaining({ |
@@ -108,5 +110,13 @@ describe("OpenClaw provider index", () => {
|
108 | 110 | ]), |
109 | 111 | ); |
110 | 112 | expect(index.providers.deepseek?.plugin.id).toBe("deepseek"); |
| 113 | +expect(index.providers.deepseek?.previewCatalog?.models).toEqual( |
| 114 | +expect.arrayContaining([ |
| 115 | +expect.objectContaining({ |
| 116 | +id: "deepseek-chat", |
| 117 | +contextWindow: 131072, |
| 118 | +}), |
| 119 | +]), |
| 120 | +); |
111 | 121 | }); |
112 | 122 | }); |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -3,6 +3,9 @@ import type { OpenClawProviderIndex } from "./types.js";
|
3 | 3 | // OpenClaw-owned preview metadata for providers whose plugins may not be |
4 | 4 | // installed yet. Installed plugin manifests remain authoritative; this index is |
5 | 5 | // a fallback for installable-provider and pre-install model picker surfaces. |
| 6 | +// Preview catalogs use the shared model catalog type, but intentionally keep to |
| 7 | +// stable display fields unless runtime adapter metadata is kept in sync with |
| 8 | +// the installed plugin manifest. |
6 | 9 | export const OPENCLAW_PROVIDER_INDEX = { |
7 | 10 | version: 1, |
8 | 11 | providers: { |
@@ -15,8 +18,6 @@ export const OPENCLAW_PROVIDER_INDEX = {
|
15 | 18 | docs: "/providers/moonshot", |
16 | 19 | categories: ["cloud", "llm"], |
17 | 20 | previewCatalog: { |
18 | | -api: "openai-responses", |
19 | | -baseUrl: "https://api.moonshot.ai/v1", |
20 | 21 | models: [ |
21 | 22 | { |
22 | 23 | id: "kimi-k2.6", |
@@ -36,21 +37,19 @@ export const OPENCLAW_PROVIDER_INDEX = {
|
36 | 37 | docs: "/providers/deepseek", |
37 | 38 | categories: ["cloud", "llm"], |
38 | 39 | previewCatalog: { |
39 | | -api: "openai-responses", |
40 | | -baseUrl: "https://api.deepseek.com/v1", |
41 | 40 | models: [ |
42 | 41 | { |
43 | 42 | id: "deepseek-chat", |
44 | 43 | name: "DeepSeek Chat", |
45 | 44 | input: ["text"], |
46 | | -contextWindow: 64000, |
| 45 | +contextWindow: 131072, |
47 | 46 | }, |
48 | 47 | { |
49 | 48 | id: "deepseek-reasoner", |
50 | 49 | name: "DeepSeek Reasoner", |
51 | 50 | input: ["text"], |
52 | 51 | reasoning: true, |
53 | | -contextWindow: 64000, |
| 52 | +contextWindow: 131072, |
54 | 53 | }, |
55 | 54 | ], |
56 | 55 | }, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。