Skip to content

Commit 083bf94

Browse files
committed
fix(qa): keep WhatsApp approval scenarios explicit
1 parent 41a3064 commit 083bf94

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

extensions/qa-lab/src/live-transports/whatsapp/whatsapp-live.runtime.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,17 @@ describe("WhatsApp QA live runtime", () => {
164164
]);
165165
});
166166

167+
it("keeps native approval scenarios out of default WhatsApp selection", () => {
168+
const expectedDefaultIds = [
169+
"whatsapp-canary",
170+
"whatsapp-pairing-block",
171+
"whatsapp-mention-gating",
172+
];
173+
174+
expect(testing.findScenarios().map(({ id }) => id)).toEqual(expectedDefaultIds);
175+
expect(testing.findScenarios([]).map(({ id }) => id)).toEqual(expectedDefaultIds);
176+
});
177+
167178
it("selects native approval scenarios by id without changing standard coverage", () => {
168179
const scenarios = testing.findScenarios([
169180
"whatsapp-approval-exec-native",
@@ -224,6 +235,9 @@ describe("WhatsApp QA live runtime", () => {
224235
it("uses automatic visible replies for WhatsApp group mention gating", () => {
225236
const [scenario] = testing.findScenarios(["whatsapp-mention-gating"]);
226237
const scenarioRun = scenario.buildRun();
238+
if (scenarioRun.kind === "approval") {
239+
throw new Error("whatsapp-mention-gating unexpectedly built an approval scenario run");
240+
}
227241
expect(scenarioRun.input).toContain("openclawqa reply with only this exact marker");
228242
expect(scenarioRun.input).not.toContain("visible reply tool check");
229243

extensions/qa-lab/src/live-transports/whatsapp/whatsapp-live.runtime.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,11 +371,16 @@ function parseWhatsAppQaCredentialPayload(payload: unknown): WhatsAppQaRuntimeEn
371371
return validateWhatsAppQaRuntimeEnv(parsed, "WhatsApp credential payload");
372372
}
373373

374+
function defaultWhatsAppQaScenarios() {
375+
return WHATSAPP_QA_SCENARIOS.filter((scenario) => scenario.standardId);
376+
}
377+
374378
function findScenarios(ids?: string[]) {
379+
const scenarios = ids && ids.length > 0 ? WHATSAPP_QA_SCENARIOS : defaultWhatsAppQaScenarios();
375380
return selectLiveTransportScenarios({
376381
ids,
377382
laneLabel: "WhatsApp",
378-
scenarios: WHATSAPP_QA_SCENARIOS,
383+
scenarios,
379384
});
380385
}
381386

0 commit comments

Comments
 (0)