Skip to content

Commit 66e14c9

Browse files
committed
fix(qa): retain inferred model provider plugins
1 parent abb4e6d commit 66e14c9

2 files changed

Lines changed: 36 additions & 3 deletions

File tree

‎extensions/qa-lab/src/qa-gateway-config.test.ts‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,34 @@ describe("buildQaGatewayConfig", () => {
287287
});
288288
});
289289

290+
it("keeps inferred live providers when scenarios require additional plugins", () => {
291+
const cfg = buildQaGatewayConfig({
292+
bind: "loopback",
293+
gatewayPort: 18789,
294+
gatewayToken: "token",
295+
workspaceDir: "/tmp/qa-workspace",
296+
providerMode: "live-frontier",
297+
primaryModel: "openai/gpt-5.6-luna",
298+
alternateModel: "anthropic/claude-sonnet-4-6",
299+
imageGenerationModel: null,
300+
enabledPluginIds: ["active-memory"],
301+
...createQaChannelTransportParams(),
302+
});
303+
304+
expect(cfg.plugins?.allow).toEqual([
305+
"acpx",
306+
"memory-core",
307+
"qa-lab",
308+
"active-memory",
309+
"openai",
310+
"anthropic",
311+
"qa-channel",
312+
]);
313+
expect(cfg.plugins?.entries?.["active-memory"]).toEqual({ enabled: true });
314+
expect(cfg.plugins?.entries?.openai).toEqual({ enabled: true });
315+
expect(cfg.plugins?.entries?.anthropic).toEqual({ enabled: true });
316+
});
317+
290318
it("keeps forced Codex cells free of OpenClaw request params", () => {
291319
const cfg = buildQaGatewayConfig({
292320
bind: "loopback",

‎extensions/qa-lab/src/qa-gateway-config.ts‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
} from "./model-selection.js";
1212
import { getQaProvider } from "./providers/index.js";
1313
import { DEFAULT_QA_PROVIDER_MODE } from "./providers/index.js";
14+
import { QA_FRONTIER_PROVIDER_IDS } from "./providers/live-frontier/catalog.js";
1415
import type { QaThinkingLevel } from "./qa-thinking.js";
1516
import type { QaTransportGatewayConfig } from "./qa-transport.js";
1617
import type { RuntimeId } from "./runtime-parity.js";
@@ -27,6 +28,7 @@ export const DEFAULT_QA_CONTROL_UI_ALLOWED_ORIGINS = Object.freeze([
2728
export const QA_BASE_RUNTIME_PLUGIN_IDS = Object.freeze(["acpx", "memory-core"]);
2829
export const QA_CODEX_OPENAI_CATALOG_BASE_URL = "https://api.openai.com/v1";
2930
const QA_LAB_PLUGIN_ID = "qa-lab";
31+
const QA_DIRECT_FRONTIER_PLUGIN_IDS = new Set<string>(QA_FRONTIER_PROVIDER_IDS);
3032

3133
export function mergeQaControlUiAllowedOrigins(extraOrigins?: string[]) {
3234
const normalizedExtra = (extraOrigins ?? [])
@@ -114,12 +116,15 @@ export function buildQaGatewayConfig(params: {
114116
.map((pluginId) => pluginId.trim())
115117
.filter((pluginId) => pluginId.length > 0),
116118
);
119+
// Only canonical frontier provider ids are also plugin ids. Provider aliases
120+
// and custom providers rely on the explicit owner mapping supplied above.
121+
const inferredProviderPluginIds = selectedProviderIds.filter((providerId) =>
122+
QA_DIRECT_FRONTIER_PLUGIN_IDS.has(providerId),
123+
);
117124
const providerSelectedPluginIds = usesCodexMockAppServer
118125
? uniqueStrings([...configuredPluginIds, ...selectedProviderIds])
119126
: provider.usesModelProviderPlugins
120-
? uniqueStrings(
121-
(params.enabledPluginIds?.length ?? 0) > 0 ? configuredPluginIds : selectedProviderIds,
122-
)
127+
? uniqueStrings([...configuredPluginIds, ...inferredProviderPluginIds])
123128
: configuredPluginIds;
124129
// A forced Codex cell must stage its harness even when the provider owner is
125130
// selected independently; otherwise its QA-only sandbox never takes effect.

0 commit comments

Comments
 (0)