Skip to content

Commit aa07d55

Browse files
authored
fix(qa): align release scenario setup and compaction proof (#119188)
* fix(qa): align release scenarios with runtime contracts * fix(qa): retain inferred model provider plugins * fix(qa): accept default OpenClaw compaction runtime
1 parent e99c289 commit aa07d55

7 files changed

Lines changed: 79 additions & 9 deletions

File tree

‎extensions/qa-lab/src/live-transports/matrix/matrix-scenario-flows.test.ts‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ describe("Matrix QA Lab scenario flows", () => {
221221
});
222222

223223
it("loads the voice preflight provider and media overrides", () => {
224+
expect(readQaScenarioById("matrix-voice-preflight-mention").plugins).toEqual(["openai"]);
224225
expect(readQaScenarioById("matrix-voice-preflight-mention").execution).toMatchObject({
225226
kind: "flow",
226227
providerMode: "mock-openai",
@@ -257,4 +258,20 @@ describe("Matrix QA Lab scenario flows", () => {
257258
},
258259
});
259260
});
261+
262+
it("loads the generated-image provider and model selection", () => {
263+
const scenario = readQaScenarioById("matrix-room-generated-image-delivery");
264+
expect(scenario.plugins).toEqual(["openai"]);
265+
expect(scenario.gatewayConfigPatch).toMatchObject({
266+
agents: {
267+
defaults: {
268+
mediaModels: {
269+
image: {
270+
primary: "openai/gpt-image-1",
271+
},
272+
},
273+
},
274+
},
275+
});
276+
});
260277
});

‎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.

‎extensions/qa-lab/src/scenario-catalog-compaction.test.ts‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ describe("qa compaction scenario catalog", () => {
7373
"OpenClaw performs exactly one successful write, one causal continuation, and returns the exact file content and final marker.",
7474
);
7575
expect(scenario.successCriteria).toContain(
76-
"OpenClaw proves session-memory.pruning by retaining tail blocks 11..15 while pruning marker block 10.",
76+
"OpenClaw proves session-memory.pruning by retaining a nonempty contiguous suffix ending at block 15 while pruning marker block 10.",
7777
);
7878
expect(scenario.successCriteria).toContain(
7979
"The Codex runtime-pair cell reports a known harness gap before gateway, session, or provider work and makes no compaction coverage claim.",
@@ -98,6 +98,14 @@ describe("qa compaction scenario catalog", () => {
9898
},
9999
},
100100
]);
101+
const runtimeGuard = scenario.execution.flow?.steps[0]?.actions[1] as
102+
| Record<string, unknown>
103+
| undefined;
104+
expect(runtimeGuard?.assert).toMatchObject({
105+
expr: expect.stringContaining(
106+
"(env.gateway.runtimeEnv.OPENCLAW_QA_FORCE_RUNTIME ?? 'openclaw') === 'openclaw'",
107+
),
108+
});
101109

102110
const knownGapIndex = flow.indexOf(knownGap);
103111
const gatewayWorkIndex = flow.indexOf('"call":"waitForGatewayHealthy"');
@@ -158,7 +166,9 @@ describe("qa compaction scenario catalog", () => {
158166
);
159167
expect(flow).toContain("!String(writeRequest.allInputText ?? '').includes(config.bulkyMarker)");
160168
expect(flow).toContain("JSON.stringify(overflowEvidence.tailBlocks)");
161-
expect(flow).toContain("JSON.stringify(['11', '12', '13', '14', '15'])");
169+
expect(flow).toContain("writeEvidence.tailBlocks.length > 0");
170+
expect(flow).toContain("!writeEvidence.tailBlocks.includes('10')");
171+
expect(flow).toContain("16 - writeEvidence.tailBlocks.length + index");
162172
expect(serializedScenario).not.toContain("remote-compaction");
163173
expect(serializedScenario).not.toContain("remoteCompaction");
164174
expect(flow).not.toContain("JSON.stringify(overflowRequest)");

‎qa/scenarios/channels/matrix-room-generated-image-delivery.yaml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,17 @@ title: Matrix generated images deliver as real image attachments while streaming
22
scenario:
33
id: matrix-room-generated-image-delivery
44
surface: channels
5+
plugins:
6+
- openai
57
coverage:
68
primary:
79
- matrix.media-and-rich-content
10+
gatewayConfigPatch:
11+
agents:
12+
defaults:
13+
mediaModels:
14+
image:
15+
primary: openai/gpt-image-1
816
execution:
917
kind: flow
1018
channel: matrix

‎qa/scenarios/channels/matrix-voice-preflight-mention.yaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ title: Matrix voice notes can trigger mention gating through transcription
22
scenario:
33
id: matrix-voice-preflight-mention
44
surface: channels
5+
plugins:
6+
- openai
57
coverage:
68
primary:
79
- matrix.media-and-rich-content

‎qa/scenarios/runtime/compaction-retry-mutating-tool.yaml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ scenario:
1313
successCriteria:
1414
- One coded over-threshold provider overflow produces one persisted OpenClaw overflow compaction and one compacted retry retaining durable current context.
1515
- OpenClaw performs exactly one successful write, one causal continuation, and returns the exact file content and final marker.
16-
- OpenClaw proves session-memory.pruning by retaining tail blocks 11..15 while pruning marker block 10.
16+
- OpenClaw proves session-memory.pruning by retaining a nonempty contiguous suffix ending at block 15 while pruning marker block 10.
1717
- OpenClaw records one overflow-retry checkpoint whose branch preserves the independent pre-compaction assistant marker.
1818
- The Codex runtime-pair cell reports a known harness gap before gateway, session, or provider work and makes no compaction coverage claim.
1919
docsRefs:
@@ -57,7 +57,7 @@ flow:
5757
- throw:
5858
expr: "new qaErrors.QaSuiteScenarioSkipError('known-harness-gap compaction-retry-mutating-tool: provider-error recovery does not invoke Codex native compaction; native token-threshold compaction needs a separate scenario.')"
5959
- assert:
60-
expr: "env.gateway.runtimeEnv.OPENCLAW_QA_FORCE_RUNTIME === 'openclaw' && env.providerMode === 'mock-openai' && Boolean(env.mock)"
60+
expr: "(env.gateway.runtimeEnv.OPENCLAW_QA_FORCE_RUNTIME ?? 'openclaw') === 'openclaw' && env.providerMode === 'mock-openai' && Boolean(env.mock)"
6161
message: compaction overflow injection requires the mock-openai OpenClaw runtime
6262
- call: waitForGatewayHealthy
6363
args:
@@ -180,9 +180,9 @@ flow:
180180
message:
181181
expr: "`OpenClaw retry did not prune marker block 10: ${JSON.stringify({ overflow: overflowEvidence, write: writeEvidence })}`"
182182
- assert:
183-
expr: "JSON.stringify(overflowEvidence.tailBlocks) === JSON.stringify(Array.from({ length: 16 }, (_, index) => String(index).padStart(2, '0'))) && JSON.stringify(writeEvidence.tailBlocks) === JSON.stringify(['11', '12', '13', '14', '15'])"
183+
expr: "JSON.stringify(overflowEvidence.tailBlocks) === JSON.stringify(Array.from({ length: 16 }, (_, index) => String(index).padStart(2, '0'))) && writeEvidence.tailBlocks.length > 0 && !writeEvidence.tailBlocks.includes('10') && JSON.stringify(writeEvidence.tailBlocks) === JSON.stringify(Array.from({ length: writeEvidence.tailBlocks.length }, (_, index) => String(16 - writeEvidence.tailBlocks.length + index).padStart(2, '0')))"
184184
message:
185-
expr: "`OpenClaw tail retention did not prove causal pruning of block 10: ${JSON.stringify({ overflow: overflowEvidence, write: writeEvidence })}`"
185+
expr: "`OpenClaw tail retention did not keep a contiguous suffix ending at block 15 while pruning block 10: ${JSON.stringify({ overflow: overflowEvidence, write: writeEvidence })}`"
186186
- assert:
187187
expr: "writeRequest.rawByteLength < config.overflowThresholdBytes && writeRequest.rawByteLength < overflowRequest.rawByteLength"
188188
message:

0 commit comments

Comments
 (0)