From 1246e476dcae8c870a77d3d885b60f6595e7f91d Mon Sep 17 00:00:00 2001 From: zhi Date: Sat, 28 Feb 2026 19:37:11 +0000 Subject: [PATCH] fix: bypass no-reply for moderator bot handoff messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add moderator bypass in before_model_resolve: if senderId equals moderatorUserId, skip no-reply evaluation to prevent moderator handoff messages from being treated as regular messages without 🔚 - Add debug log when bypass is triggered --- plugin/index.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plugin/index.ts b/plugin/index.ts index 2dd9411..0abe30c 100644 --- a/plugin/index.ts +++ b/plugin/index.ts @@ -581,6 +581,18 @@ export default { const hasConvMarker = prompt.includes("Conversation info (untrusted metadata):"); 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); if (!rec || Date.now() - rec.createdAt > DECISION_TTL_MS) { if (rec) sessionDecision.delete(key);