Guard swarm voice rendering on listeners

This commit is contained in:
Meta Vens 2026-06-13 20:43:20 +01:00
commit 2c0b0a5781
7 changed files with 110 additions and 3 deletions

View file

@ -15,7 +15,9 @@ import {
applyVoidSelfStateOperation,
findRepoDiscordIdentity,
faceRegistryAsRepoDiscordRegistry,
hasFreshHumanRepoFaceVoiceListener,
isRepoDiscordIdentityAllowedInChannel,
loadRepoFaceVoicePresenceSnapshot,
type JobQueue,
loadFaceIdentityRegistry,
loadSystemMessageCatalog,
@ -1458,6 +1460,19 @@ async function maybeRenderRepoIdentityWeksaSpeech(input: {
if (!config.repoFaceWeksaSpeech.enabled) {
return;
}
if (!config.repoFaceDiscordVoice.enabled) {
return;
}
const voicePresence = await loadRepoFaceVoicePresenceSnapshot(config.repoFaceDiscordVoice.presencePath);
if (!hasFreshHumanRepoFaceVoiceListener({
snapshot: voicePresence,
channelId: config.repoFaceDiscordVoice.channelId,
})) {
console.log(
`Skipped Weksa speech for repo identity ${input.identity.id} message ${input.messageId}: no fresh human listener signal for configured Aquarium voice channel.`,
);
return;
}
if (!input.identity.faceStatePath) {
console.warn(
`Skipped Weksa speech for repo identity ${input.identity.id}: no faceStatePath is registered.`,