qa-lab: drop qa-channel from live transport lanes

This commit is contained in:
Gustavo Madeira Santana
2026-04-10 14:28:08 -04:00
parent f63c85aaf8
commit 0d457fd14d
5 changed files with 41 additions and 12 deletions

View File

@@ -720,6 +720,7 @@ export async function startQaGatewayChild(params: {
repoRoot: string;
providerBaseUrl?: string;
qaBusBaseUrl: string;
includeQaChannel?: boolean;
controlUiAllowedOrigins?: string[];
providerMode?: "mock-openai" | "live-frontier";
primaryModel?: string;
@@ -780,6 +781,7 @@ export async function startQaGatewayChild(params: {
gatewayToken,
providerBaseUrl: params.providerBaseUrl,
qaBusBaseUrl: params.qaBusBaseUrl,
includeQaChannel: params.includeQaChannel,
workspaceDir,
controlUiRoot: resolveQaControlUiRoot({
repoRoot: params.repoRoot,

View File

@@ -54,6 +54,7 @@ describe("startQaLiveLaneGateway", () => {
});
expect(startQaGatewayChild).toHaveBeenCalledWith(
expect.objectContaining({
includeQaChannel: false,
providerBaseUrl: "http://127.0.0.1:44080/v1",
providerMode: "mock-openai",
}),
@@ -77,6 +78,7 @@ describe("startQaLiveLaneGateway", () => {
expect(startQaMockOpenAiServer).not.toHaveBeenCalled();
expect(startQaGatewayChild).toHaveBeenCalledWith(
expect.objectContaining({
includeQaChannel: false,
providerBaseUrl: undefined,
providerMode: "live-frontier",
}),

View File

@@ -28,6 +28,7 @@ export async function startQaLiveLaneGateway(params: {
repoRoot: params.repoRoot,
providerBaseUrl: mock ? `${mock.baseUrl}/v1` : undefined,
qaBusBaseUrl: params.qaBusBaseUrl,
includeQaChannel: false,
controlUiAllowedOrigins: params.controlUiAllowedOrigins,
providerMode: params.providerMode,
primaryModel: params.primaryModel,

View File

@@ -31,10 +31,27 @@ describe("buildQaGatewayConfig", () => {
expect(cfg.models?.providers?.["mock-openai"]?.baseUrl).toBe("http://127.0.0.1:44080/v1");
expect(cfg.plugins?.allow).toEqual(["memory-core", "qa-channel"]);
expect(cfg.plugins?.entries?.["memory-core"]).toEqual({ enabled: true });
expect(cfg.plugins?.entries?.["qa-channel"]).toEqual({ enabled: true });
expect(cfg.plugins?.entries?.openai).toBeUndefined();
expect(cfg.gateway?.reload?.deferralTimeoutMs).toBe(1_000);
});
it("can omit qa-channel for live transport gateway children", () => {
const cfg = buildQaGatewayConfig({
bind: "loopback",
gatewayPort: 18789,
gatewayToken: "token",
providerBaseUrl: "http://127.0.0.1:44080/v1",
qaBusBaseUrl: "http://127.0.0.1:43124",
includeQaChannel: false,
workspaceDir: "/tmp/qa-workspace",
});
expect(cfg.plugins?.allow).toEqual(["memory-core"]);
expect(cfg.plugins?.entries?.["qa-channel"]).toBeUndefined();
expect(cfg.channels?.["qa-channel"]).toBeUndefined();
});
it("uses built-in provider wiring in frontier live mode", () => {
const cfg = buildQaGatewayConfig({
bind: "loopback",

View File

@@ -57,6 +57,7 @@ export function buildQaGatewayConfig(params: {
gatewayToken: string;
providerBaseUrl?: string;
qaBusBaseUrl: string;
includeQaChannel?: boolean;
workspaceDir: string;
controlUiRoot?: string;
controlUiAllowedOrigins?: string[];
@@ -71,6 +72,7 @@ export function buildQaGatewayConfig(params: {
fastMode?: boolean;
thinkingDefault?: QaThinkingLevel;
}): OpenClawConfig {
const includeQaChannel = params.includeQaChannel !== false;
const mockProviderBaseUrl = params.providerBaseUrl ?? "http://127.0.0.1:44080/v1";
const mockOpenAiProvider: ModelProviderConfig = {
baseUrl: mockProviderBaseUrl,
@@ -167,8 +169,8 @@ export function buildQaGatewayConfig(params: {
: {};
const allowedPlugins =
providerMode === "live-frontier"
? ["memory-core", ...selectedPluginIds, "qa-channel"]
: ["memory-core", "qa-channel"];
? ["memory-core", ...selectedPluginIds, ...(includeQaChannel ? ["qa-channel"] : [])]
: ["memory-core", ...(includeQaChannel ? ["qa-channel"] : [])];
const liveModelParams =
providerMode === "live-frontier"
? (modelRef: string) => ({
@@ -197,6 +199,7 @@ export function buildQaGatewayConfig(params: {
enabled: true,
},
...pluginEntries,
...(includeQaChannel ? { "qa-channel": { enabled: true } } : {}),
},
},
agents: {
@@ -304,16 +307,20 @@ export function buildQaGatewayConfig(params: {
mode: "off",
},
},
channels: {
"qa-channel": {
enabled: true,
baseUrl: params.qaBusBaseUrl,
botUserId: "openclaw",
botDisplayName: "OpenClaw QA",
allowFrom: ["*"],
pollTimeoutMs: 250,
},
},
...(includeQaChannel
? {
channels: {
"qa-channel": {
enabled: true,
baseUrl: params.qaBusBaseUrl,
botUserId: "openclaw",
botDisplayName: "OpenClaw QA",
allowFrom: ["*"],
pollTimeoutMs: 250,
},
},
}
: {}),
messages: {
groupChat: {
mentionPatterns: ["\\b@?openclaw\\b"],