fix: seed release provider config models

This commit is contained in:
Peter Steinberger
2026-05-02 07:29:27 +01:00
parent 31eacdd981
commit 5c590fc64b
2 changed files with 45 additions and 1 deletions

View File

@@ -80,6 +80,12 @@ export function buildCrossOsReleaseSmokePluginAllowlist(providerMeta) {
return [...new Set([providerMeta.extensionId, ...RELEASE_SMOKE_PLUGIN_ALLOWLIST_BASE])];
}
function shouldSeedProviderConfigModels(providerMeta) {
return (
typeof providerMeta.baseUrl === "string" || typeof providerMeta.timeoutSeconds === "number"
);
}
const PACKAGE_DIST_INVENTORY_RELATIVE_PATH = "dist/postinstall-inventory.json";
const OMITTED_QA_EXTENSION_PREFIXES = [
"dist/extensions/qa-channel/",
@@ -1842,6 +1848,23 @@ async function runInstalledModelsSet(params) {
logPath: params.logPath,
timeoutMs: 2 * 60 * 1000,
});
if (shouldSeedProviderConfigModels(params.providerConfig)) {
await runInstalledCli({
cliPath: params.cliPath,
args: [
"config",
"set",
`models.providers.${params.providerConfig.extensionId}.models`,
"[]",
"--strict-json",
"--merge",
],
cwd: params.cwd,
env: params.env,
logPath: params.logPath,
timeoutMs: 2 * 60 * 1000,
});
}
if (typeof params.providerConfig.timeoutSeconds === "number") {
if (typeof params.providerConfig.baseUrl === "string") {
await runInstalledCli({
@@ -2650,6 +2673,22 @@ async function runModelsSet(params) {
logPath: params.logPath,
timeoutMs: 2 * 60 * 1000,
});
if (shouldSeedProviderConfigModels(params.providerConfig)) {
await runOpenClaw({
lane: params.lane,
env: params.env,
args: [
"config",
"set",
`models.providers.${params.providerConfig.extensionId}.models`,
"[]",
"--strict-json",
"--merge",
],
logPath: params.logPath,
timeoutMs: 2 * 60 * 1000,
});
}
if (typeof params.providerConfig.timeoutSeconds === "number") {
if (typeof params.providerConfig.baseUrl === "string") {
await runOpenClaw({