Files
openclaw/extensions/qa-lab/src/model-switch-eval.ts
T
2026-04-07 22:57:52 +01:00

21 lines
910 B
TypeScript

import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/text-runtime";
export function hasModelSwitchContinuityEvidence(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("kickoff task") ||
lower.includes("qa mission");
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;
}