From cfc699d3f672066cd469e6d983cbc2f34fe97359 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Sat, 20 Jun 2026 09:33:19 +0800 Subject: [PATCH] refactor(qa): reuse model ref splitter --- extensions/qa-lab/src/suite-planning.ts | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/extensions/qa-lab/src/suite-planning.ts b/extensions/qa-lab/src/suite-planning.ts index efa37bc4b3e..faf3745bb2f 100644 --- a/extensions/qa-lab/src/suite-planning.ts +++ b/extensions/qa-lab/src/suite-planning.ts @@ -4,7 +4,7 @@ import { parseStrictNonNegativeInteger } from "openclaw/plugin-sdk/number-runtim import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime"; import { ensureRepoBoundDirectory, resolveRepoRelativeOutputDir } from "./cli-paths.js"; import type { QaCliBackendAuthMode } from "./gateway-child.js"; -import type { QaProviderMode } from "./model-selection.js"; +import { splitQaModelRef as splitModelRef, type QaProviderMode } from "./model-selection.js"; import { getQaProvider } from "./providers/index.js"; import { readQaBootstrapScenarioCatalog } from "./scenario-catalog.js"; import { applyQaMergePatch, isQaMergePatchObject } from "./suite-merge-patch.js"; @@ -14,17 +14,6 @@ const DEFAULT_QA_SUITE_WORKER_START_STAGGER_MS = 1_500; type QaSeedScenario = ReturnType["scenarios"][number]; -function splitModelRef(ref: string) { - const slash = ref.indexOf("/"); - if (slash <= 0 || slash === ref.length - 1) { - return null; - } - return { - provider: ref.slice(0, slash), - model: ref.slice(slash + 1), - }; -} - function normalizeQaConfigString(value: unknown): string | undefined { return typeof value === "string" && value.trim() ? value.trim() : undefined; }