refactor(agent): dedupe harness and command workflows

This commit is contained in:
Peter Steinberger
2026-02-16 14:52:09 +00:00
parent 04892ee230
commit f717a13039
204 changed files with 7366 additions and 11540 deletions

View File

@@ -1,6 +1,9 @@
import type { OpenClawConfig } from "../config/config.js";
import type { ModelProviderConfig } from "../config/types.models.js";
import { applyOnboardAuthAgentModelsAndProviders } from "./onboard-auth.config-shared.js";
import {
applyAgentDefaultModelPrimary,
applyOnboardAuthAgentModelsAndProviders,
} from "./onboard-auth.config-shared.js";
import {
buildMinimaxApiModelDefinition,
buildMinimaxModelDefinition,
@@ -82,24 +85,7 @@ export function applyMinimaxHostedProviderConfig(
export function applyMinimaxConfig(cfg: OpenClawConfig): OpenClawConfig {
const next = applyMinimaxProviderConfig(cfg);
return {
...next,
agents: {
...next.agents,
defaults: {
...next.agents?.defaults,
model: {
...(next.agents?.defaults?.model &&
"fallbacks" in (next.agents.defaults.model as Record<string, unknown>)
? {
fallbacks: (next.agents.defaults.model as { fallbacks?: string[] }).fallbacks,
}
: undefined),
primary: "lmstudio/minimax-m2.1-gs32",
},
},
},
};
return applyAgentDefaultModelPrimary(next, "lmstudio/minimax-m2.1-gs32");
}
export function applyMinimaxHostedConfig(
@@ -223,22 +209,5 @@ function applyMinimaxApiConfigWithBaseUrl(
params: MinimaxApiProviderConfigParams,
): OpenClawConfig {
const next = applyMinimaxApiProviderConfigWithBaseUrl(cfg, params);
return {
...next,
agents: {
...next.agents,
defaults: {
...next.agents?.defaults,
model: {
...(next.agents?.defaults?.model &&
"fallbacks" in (next.agents.defaults.model as Record<string, unknown>)
? {
fallbacks: (next.agents.defaults.model as { fallbacks?: string[] }).fallbacks,
}
: undefined),
primary: `${params.providerId}/${params.modelId}`,
},
},
},
};
return applyAgentDefaultModelPrimary(next, `${params.providerId}/${params.modelId}`);
}