QA: replace qa-lab-runtime with qa-runtime

Introduce a tiny generic qa-runtime seam for shared live-lane helpers and
repoint qa-matrix to it. This keeps the qa-lab host split while removing
the host-owned runtime name from runner code.

Drop the old qa-lab-runtime shim/export now that nothing consumes it and
keep the plugin-sdk surface aligned with the new seam.
This commit is contained in:
Gustavo Madeira Santana
2026-04-14 18:53:25 -04:00
parent 58742acaab
commit 95be2c1605
7 changed files with 107 additions and 19 deletions

View File

@@ -1,18 +1,20 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
const loadQaLabRuntimeModule = vi.hoisted(() => vi.fn());
const loadQaRuntimeModule = vi.hoisted(() => vi.fn());
const defaultQaRuntimeModelForMode = vi.hoisted(() => vi.fn());
vi.mock("openclaw/plugin-sdk/qa-lab-runtime", () => ({
loadQaLabRuntimeModule,
vi.mock("openclaw/plugin-sdk/qa-runtime", () => ({
loadQaRuntimeModule,
}));
describe("matrix qa model selection", () => {
beforeEach(() => {
defaultQaRuntimeModelForMode.mockReset().mockImplementation((mode, options) =>
options?.alternate ? `${mode}:alt` : `${mode}:primary`,
);
loadQaLabRuntimeModule.mockReset().mockReturnValue({
defaultQaRuntimeModelForMode
.mockReset()
.mockImplementation((mode, options) =>
options?.alternate ? `${mode}:alt` : `${mode}:primary`,
);
loadQaRuntimeModule.mockReset().mockReturnValue({
defaultQaRuntimeModelForMode,
});
});
@@ -45,7 +47,7 @@ describe("matrix qa model selection", () => {
primaryModel: "custom-primary",
alternateModel: "custom-alt",
});
expect(loadQaLabRuntimeModule).not.toHaveBeenCalled();
expect(loadQaRuntimeModule).not.toHaveBeenCalled();
expect(defaultQaRuntimeModelForMode).not.toHaveBeenCalled();
});
});

View File

@@ -1,4 +1,4 @@
import { loadQaLabRuntimeModule } from "openclaw/plugin-sdk/qa-lab-runtime";
import { loadQaRuntimeModule } from "openclaw/plugin-sdk/qa-runtime";
import { normalizeQaProviderMode, type QaProviderModeInput } from "../../run-config.js";
export type ResolvedMatrixQaModels = {
@@ -23,11 +23,11 @@ export function resolveMatrixQaModels(params: {
};
}
const qaLabRuntime = loadQaLabRuntimeModule();
const qaRuntime = loadQaRuntimeModule();
return {
providerMode,
primaryModel: primaryModel || qaLabRuntime.defaultQaRuntimeModelForMode(providerMode),
primaryModel: primaryModel || qaRuntime.defaultQaRuntimeModelForMode(providerMode),
alternateModel:
alternateModel || qaLabRuntime.defaultQaRuntimeModelForMode(providerMode, { alternate: true }),
alternateModel || qaRuntime.defaultQaRuntimeModelForMode(providerMode, { alternate: true }),
};
}

View File

@@ -4,7 +4,7 @@ import path from "node:path";
import { setTimeout as sleep } from "node:timers/promises";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
import { loadQaLabRuntimeModule } from "openclaw/plugin-sdk/qa-lab-runtime";
import { loadQaRuntimeModule } from "openclaw/plugin-sdk/qa-runtime";
import type { QaReportCheck } from "../../report.js";
import { renderQaMarkdownReport } from "../../report.js";
import { type QaProviderModeInput } from "../../run-config.js";
@@ -18,6 +18,7 @@ import {
type MatrixQaProvisionResult,
} from "../../substrate/client.js";
import { startMatrixQaHarness } from "../../substrate/harness.runtime.js";
import { resolveMatrixQaModels } from "./model-selection.js";
import {
MATRIX_QA_SCENARIOS,
buildMatrixReplyDetails,
@@ -27,7 +28,6 @@ import {
type MatrixQaCanaryArtifact,
type MatrixQaScenarioArtifacts,
} from "./scenarios.js";
import { resolveMatrixQaModels } from "./model-selection.js";
type MatrixQaGatewayChild = {
call(
@@ -284,7 +284,7 @@ async function startMatrixQaLiveLaneGateway(params: {
controlUiEnabled?: boolean;
mutateConfig?: (cfg: OpenClawConfig) => OpenClawConfig;
}): Promise<MatrixQaLiveLaneGatewayHarness> {
return (await loadQaLabRuntimeModule().startQaLiveLaneGateway(
return (await loadQaRuntimeModule().startQaLiveLaneGateway(
params,
)) as MatrixQaLiveLaneGatewayHarness;
}