fix: add augmentModelCatalog hooks to bundled providers for proper filtering

This commit is contained in:
Mingxuan 2026-04-01 14:16:05 +08:00 committed by Peter Steinberger
parent 792558de01
commit fd3b7b5ae7
3 changed files with 47 additions and 0 deletions

View File

@ -2,6 +2,10 @@ import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
import { createProviderApiKeyAuthMethod } from "openclaw/plugin-sdk/provider-auth-api-key";
import { ensureModelAllowlistEntry } from "openclaw/plugin-sdk/provider-onboard";
import { buildBytePlusCodingProvider, buildBytePlusProvider } from "./provider-catalog.js";
import {
BYTEPLUS_CODING_MODEL_CATALOG,
BYTEPLUS_MODEL_CATALOG,
} from "./models.js";
const PROVIDER_ID = "byteplus";
const BYTEPLUS_DEFAULT_MODEL_REF = "byteplus-plan/ark-code-latest";
@ -57,6 +61,25 @@ export default definePluginEntry({
};
},
},
augmentModelCatalog: () => {
const byteplusModels = BYTEPLUS_MODEL_CATALOG.map((entry) => ({
provider: "byteplus",
id: entry.id,
name: entry.name,
reasoning: entry.reasoning,
input: [...entry.input],
contextWindow: entry.contextWindow,
}));
const byteplusPlanModels = BYTEPLUS_CODING_MODEL_CATALOG.map((entry) => ({
provider: "byteplus-plan",
id: entry.id,
name: entry.name,
reasoning: entry.reasoning,
input: [...entry.input],
contextWindow: entry.contextWindow,
}));
return [...byteplusModels, ...byteplusPlanModels];
},
});
},
});

View File

@ -2,6 +2,10 @@ import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
import { createProviderApiKeyAuthMethod } from "openclaw/plugin-sdk/provider-auth-api-key";
import { ensureModelAllowlistEntry } from "openclaw/plugin-sdk/provider-onboard";
import { buildDoubaoCodingProvider, buildDoubaoProvider } from "./provider-catalog.js";
import {
DOUBAO_CODING_MODEL_CATALOG,
DOUBAO_MODEL_CATALOG,
} from "./models.js";
const PROVIDER_ID = "volcengine";
const VOLCENGINE_DEFAULT_MODEL_REF = "volcengine-plan/ark-code-latest";
@ -57,6 +61,25 @@ export default definePluginEntry({
};
},
},
augmentModelCatalog: () => {
const volcengineModels = DOUBAO_MODEL_CATALOG.map((entry) => ({
provider: "volcengine",
id: entry.id,
name: entry.name,
reasoning: entry.reasoning,
input: [...entry.input],
contextWindow: entry.contextWindow,
}));
const volcenginePlanModels = DOUBAO_CODING_MODEL_CATALOG.map((entry) => ({
provider: "volcengine-plan",
id: entry.id,
name: entry.name,
reasoning: entry.reasoning,
input: [...entry.input],
contextWindow: entry.contextWindow,
}));
return [...volcengineModels, ...volcenginePlanModels];
},
});
},
});

View File

@ -295,6 +295,7 @@ export function resolveCatalogHookProviderPluginIds(params: {
origin: plugin.origin,
config: normalizedConfig,
rootConfig: params.config,
enabledByDefault: plugin.enabledByDefault,
}).activated,
)
.map((plugin) => plugin.id);