fix: honor /new resets with mentions in groups

This commit is contained in:
Peter Steinberger
2025-12-23 13:20:11 +00:00
parent c8c807adcc
commit e54ed10bc1
2 changed files with 7 additions and 5 deletions

View File

@@ -15,6 +15,7 @@
- Group chats now honor `inbound.groupChat.requireMention=false` as the default activation when no per-group override exists. - 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. - Gateway auth no longer supports PAM/system mode; use token or shared password.
- Tailscale Funnel now requires password auth (no token-only public exposure). - 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`. - Canvas defaults/A2UI auto-nav aligned; debug status overlay centered; redundant await removed in `CanvasManager`.
- Gateway launchd loop fixed by removing redundant `kickstart -k`. - Gateway launchd loop fixed by removing redundant `kickstart -k`.
- CLI now hints when Peekaboo is unauthorized. - CLI now hints when Peekaboo is unauthorized.

View File

@@ -243,6 +243,9 @@ export async function getReplyFromConfig(
let persistedThinking: string | undefined; let persistedThinking: string | undefined;
let persistedVerbose: 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 ?? "") const triggerBodyNormalized = stripStructuralPrefixes(ctx.Body ?? "")
.trim() .trim()
.toLowerCase(); .toLowerCase();
@@ -252,7 +255,9 @@ export async function getReplyFromConfig(
// Timestamp/message prefixes (e.g. "[Dec 4 17:35] ") are added by the // 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" // web inbox before we get here. They prevented reset triggers like "/new"
// from matching, so strip structural wrappers when checking for resets. // 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) { for (const trigger of resetTriggers) {
if (!trigger) continue; if (!trigger) continue;
if (trimmedBody === trigger || strippedForReset === trigger) { if (trimmedBody === trigger || strippedForReset === trigger) {
@@ -331,10 +336,6 @@ export async function getReplyFromConfig(
return requireMention === false ? "always" : "mention"; return requireMention === false ? "always" : "mention";
}; };
const isGroup =
typeof ctx.From === "string" &&
(ctx.From.includes("@g.us") || ctx.From.startsWith("group:"));
let resolvedThinkLevel = let resolvedThinkLevel =
inlineThink ?? inlineThink ??
(sessionEntry?.thinkingLevel as ThinkLevel | undefined) ?? (sessionEntry?.thinkingLevel as ThinkLevel | undefined) ??