fix: fix: transcribe audio before mention check in groups with requireMention (openclaw#9973) thanks @mcinteerj

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test

Co-authored-by: mcinteerj <3613653+mcinteerj@users.noreply.github.com>
This commit is contained in:
Jake
2026-02-13 04:58:01 +13:00
committed by GitHub
parent a5ab9fac0c
commit a2ddcdadeb
7 changed files with 245 additions and 38 deletions

View File

@@ -90,18 +90,24 @@ export function matchesMentionWithExplicit(params: {
text: string;
mentionRegexes: RegExp[];
explicit?: ExplicitMentionSignal;
transcript?: string;
}): boolean {
const cleaned = normalizeMentionText(params.text ?? "");
const explicit = params.explicit?.isExplicitlyMentioned === true;
const explicitAvailable = params.explicit?.canResolveExplicit === true;
const hasAnyMention = params.explicit?.hasAnyMention === true;
// Check transcript if text is empty and transcript is provided
const transcriptCleaned = params.transcript ? normalizeMentionText(params.transcript) : "";
const textToCheck = cleaned || transcriptCleaned;
if (hasAnyMention && explicitAvailable) {
return explicit || params.mentionRegexes.some((re) => re.test(cleaned));
return explicit || params.mentionRegexes.some((re) => re.test(textToCheck));
}
if (!cleaned) {
if (!textToCheck) {
return explicit;
}
return explicit || params.mentionRegexes.some((re) => re.test(cleaned));
return explicit || params.mentionRegexes.some((re) => re.test(textToCheck));
}
export function stripStructuralPrefixes(text: string): string {