mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 09:41:11 +00:00
fix(test): restore bundled loader coverage
This commit is contained in:
@@ -1,37 +1,9 @@
|
||||
import {
|
||||
applyAgentDefaultModelPrimary,
|
||||
resolveAgentModelPrimaryValue,
|
||||
export {
|
||||
applyOpencodeZenModelDefault,
|
||||
OPENCODE_ZEN_DEFAULT_MODEL,
|
||||
} from "openclaw/plugin-sdk/provider-onboard";
|
||||
import { OPENCODE_ZEN_DEFAULT_MODEL_REF } from "./onboard.js";
|
||||
export {
|
||||
applyOpencodeZenConfig,
|
||||
applyOpencodeZenProviderConfig,
|
||||
OPENCODE_ZEN_DEFAULT_MODEL_REF,
|
||||
} from "./onboard.js";
|
||||
|
||||
const LEGACY_OPENCODE_ZEN_DEFAULT_MODELS = new Set([
|
||||
"opencode/claude-opus-4-5",
|
||||
"opencode-zen/claude-opus-4-5",
|
||||
]);
|
||||
|
||||
export const OPENCODE_ZEN_DEFAULT_MODEL = OPENCODE_ZEN_DEFAULT_MODEL_REF;
|
||||
|
||||
export function applyOpencodeZenModelDefault(
|
||||
cfg: import("openclaw/plugin-sdk/provider-onboard").OpenClawConfig,
|
||||
): {
|
||||
next: import("openclaw/plugin-sdk/provider-onboard").OpenClawConfig;
|
||||
changed: boolean;
|
||||
} {
|
||||
const current = resolveAgentModelPrimaryValue(cfg.agents?.defaults?.model);
|
||||
const normalizedCurrent =
|
||||
current && LEGACY_OPENCODE_ZEN_DEFAULT_MODELS.has(current)
|
||||
? OPENCODE_ZEN_DEFAULT_MODEL
|
||||
: current;
|
||||
if (normalizedCurrent === OPENCODE_ZEN_DEFAULT_MODEL) {
|
||||
return { next: cfg, changed: false };
|
||||
}
|
||||
return {
|
||||
next: applyAgentDefaultModelPrimary(cfg, OPENCODE_ZEN_DEFAULT_MODEL),
|
||||
changed: true,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user