fix(test): restore bundled loader coverage

This commit is contained in:
Peter Steinberger
2026-04-06 18:14:37 +01:00
parent 96b39e01b4
commit 348cd6b17a
15 changed files with 207 additions and 58 deletions

View File

@@ -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,
};
}