fix: bypass no-reply for moderator bot handoff messages #7

Closed
zhi wants to merge 4 commits from fix/moderator-bypass into feat/turn-based-speaking
Showing only changes of commit 1246e476dc - Show all commits

View File

@@ -581,6 +581,18 @@ export default {
const hasConvMarker = prompt.includes("Conversation info (untrusted metadata):"); const hasConvMarker = prompt.includes("Conversation info (untrusted metadata):");
if (live.discordOnly !== false && (!hasConvMarker || derived.channel !== "discord")) return; if (live.discordOnly !== false && (!hasConvMarker || derived.channel !== "discord")) return;
// Moderator bypass: if sender is the moderator bot, don't trigger no-reply
// This prevents moderator handoff messages from being treated as regular messages without 🔚
const moderatorUserId = getModeratorUserId(live);
if (moderatorUserId && derived.senderId === moderatorUserId) {
if (shouldDebugLog(live, derived.channelId)) {
api.logger.info(
`whispergate: moderator bypass for senderId=${derived.senderId}, skipping no-reply`,
);
}
return;
}
let rec = sessionDecision.get(key); let rec = sessionDecision.get(key);
if (!rec || Date.now() - rec.createdAt > DECISION_TTL_MS) { if (!rec || Date.now() - rec.createdAt > DECISION_TTL_MS) {
if (rec) sessionDecision.delete(key); if (rec) sessionDecision.delete(key);