From e54ed10bc1f43aef4529e5bac751f30687dbeed9 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 23 Dec 2025 13:20:11 +0000 Subject: [PATCH] fix: honor /new resets with mentions in groups --- CHANGELOG.md | 1 + src/auto-reply/reply.ts | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 13ae8295c..3864f8af3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ - Group chats now honor `inbound.groupChat.requireMention=false` as the default activation when no per-group override exists. - Gateway auth no longer supports PAM/system mode; use token or shared password. - Tailscale Funnel now requires password auth (no token-only public exposure). +- Group `/new` resets now work with @mentions so activation guidance appears on fresh sessions. - Canvas defaults/A2UI auto-nav aligned; debug status overlay centered; redundant await removed in `CanvasManager`. - Gateway launchd loop fixed by removing redundant `kickstart -k`. - CLI now hints when Peekaboo is unauthorized. diff --git a/src/auto-reply/reply.ts b/src/auto-reply/reply.ts index fc7cc040e..413698e76 100644 --- a/src/auto-reply/reply.ts +++ b/src/auto-reply/reply.ts @@ -243,6 +243,9 @@ export async function getReplyFromConfig( let persistedThinking: string | undefined; let persistedVerbose: string | undefined; + const isGroup = + typeof ctx.From === "string" && + (ctx.From.includes("@g.us") || ctx.From.startsWith("group:")); const triggerBodyNormalized = stripStructuralPrefixes(ctx.Body ?? "") .trim() .toLowerCase(); @@ -252,7 +255,9 @@ export async function getReplyFromConfig( // Timestamp/message prefixes (e.g. "[Dec 4 17:35] ") are added by the // web inbox before we get here. They prevented reset triggers like "/new" // from matching, so strip structural wrappers when checking for resets. - const strippedForReset = triggerBodyNormalized; + const strippedForReset = isGroup + ? stripMentions(triggerBodyNormalized, ctx, cfg) + : triggerBodyNormalized; for (const trigger of resetTriggers) { if (!trigger) continue; if (trimmedBody === trigger || strippedForReset === trigger) { @@ -331,10 +336,6 @@ export async function getReplyFromConfig( return requireMention === false ? "always" : "mention"; }; - const isGroup = - typeof ctx.From === "string" && - (ctx.From.includes("@g.us") || ctx.From.startsWith("group:")); - let resolvedThinkLevel = inlineThink ?? (sessionEntry?.thinkingLevel as ThinkLevel | undefined) ??