mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 10:30:44 +00:00
QA: keep explicit Matrix model overrides lazy
Avoid loading the qa-lab runtime model-default seam when the Matrix runner was already given both primary and alternate model refs explicitly. Behavior stays the same, but the helper becomes easier to read and avoids an unnecessary runtime dependency on the fully-explicit path.
This commit is contained in:
@@ -45,6 +45,7 @@ describe("matrix qa model selection", () => {
|
||||
primaryModel: "custom-primary",
|
||||
alternateModel: "custom-alt",
|
||||
});
|
||||
expect(loadQaLabRuntimeModule).not.toHaveBeenCalled();
|
||||
expect(defaultQaRuntimeModelForMode).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -13,14 +13,21 @@ export function resolveMatrixQaModels(params: {
|
||||
alternateModel?: string;
|
||||
}): ResolvedMatrixQaModels {
|
||||
const providerMode = normalizeQaProviderMode(params.providerMode ?? "live-frontier");
|
||||
const primaryModel = params.primaryModel?.trim();
|
||||
const alternateModel = params.alternateModel?.trim();
|
||||
if (primaryModel && alternateModel) {
|
||||
return {
|
||||
providerMode,
|
||||
primaryModel,
|
||||
alternateModel,
|
||||
};
|
||||
}
|
||||
|
||||
const qaLabRuntime = loadQaLabRuntimeModule();
|
||||
return {
|
||||
providerMode,
|
||||
primaryModel:
|
||||
params.primaryModel?.trim() ||
|
||||
qaLabRuntime.defaultQaRuntimeModelForMode(providerMode),
|
||||
primaryModel: primaryModel || qaLabRuntime.defaultQaRuntimeModelForMode(providerMode),
|
||||
alternateModel:
|
||||
params.alternateModel?.trim() ||
|
||||
qaLabRuntime.defaultQaRuntimeModelForMode(providerMode, { alternate: true }),
|
||||
alternateModel || qaLabRuntime.defaultQaRuntimeModelForMode(providerMode, { alternate: true }),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user