mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:40:44 +00:00
fix: seed release provider config models
This commit is contained in:
@@ -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({
|
||||
|
||||
@@ -162,10 +162,15 @@ describe("scripts/openclaw-cross-os-release-checks", () => {
|
||||
|
||||
it("keeps cross-OS live smoke agent turns on GPT-5.5-safe timeouts and minimal thinking", () => {
|
||||
const source = readFileSync("scripts/openclaw-cross-os-release-checks.ts", "utf8");
|
||||
const providerModelsSeed = "models.providers.${params.providerConfig.extensionId}.models";
|
||||
const providerBaseUrl = "models.providers.${params.providerConfig.extensionId}.baseUrl";
|
||||
|
||||
expect(source).toContain('"--thinking",\n "minimal"');
|
||||
expect(CROSS_OS_AGENT_TURN_TIMEOUT_SECONDS).toBeGreaterThanOrEqual(600);
|
||||
expect(source).toContain("models.providers.${params.providerConfig.extensionId}.baseUrl");
|
||||
expect(source.indexOf(providerModelsSeed)).toBeGreaterThan(-1);
|
||||
expect(source.indexOf(providerModelsSeed)).toBeLessThan(source.indexOf(providerBaseUrl));
|
||||
expect(source).toContain('"--merge"');
|
||||
expect(source).toContain(providerBaseUrl);
|
||||
expect(source).toContain(
|
||||
"models.providers.${params.providerConfig.extensionId}.timeoutSeconds",
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user