Files
openclaw/extensions/qa-lab/src/model-switch-eval.ts
Dallin Romney fef8394079 Convert QA scenarios to YAML files (#92915)
* refactor: load QA scenarios from YAML

* docs: update personal QA scenario docs

* test: keep QA scenarios YAML-only
2026-06-14 17:31:18 -07:00

30 lines
1.3 KiB
TypeScript

// Qa Lab plugin module implements model switch eval behavior.
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
export function hasModelSwitchContinuitySignal(text: string) {
const lower = normalizeLowercaseStringOrEmpty(text);
const mentionsHandoff =
lower.includes("handoff") || lower.includes("model switch") || lower.includes("switched");
const mentionsKickoffTask =
lower.includes("qa_kickoff_task") ||
lower.includes("qa/scenarios/index.yaml") ||
lower.includes("scenario pack") ||
lower.includes("kickoff task") ||
lower.includes("kickoff note") ||
lower.includes("qa mission") ||
(lower.includes("source and docs") &&
lower.includes("qa-channel scenarios") &&
lower.includes("worked") &&
lower.includes("blocked") &&
lower.includes("follow-up"));
const hasScopeLeak =
lower.includes("subagent-handoff") ||
lower.includes("delegated task") ||
lower.includes("final qa tally") ||
lower.includes("qa run complete") ||
lower.includes("all mandatory scenarios");
const looksOverlong =
text.length > 280 || text.includes("\n\n") || text.includes("|---") || text.includes("### ");
return mentionsHandoff && mentionsKickoffTask && !hasScopeLeak && !looksOverlong;
}