diff --git a/src/auto-reply/reply/abort.ts b/src/auto-reply/reply/abort.ts index 0d9f7b028..b60fb8bd6 100644 --- a/src/auto-reply/reply/abort.ts +++ b/src/auto-reply/reply/abort.ts @@ -15,7 +15,10 @@ import type { MsgContext } from "../templating.js"; import { logVerbose } from "../../globals.js"; import { stripMentions, stripStructuralPrefixes } from "./mentions.js"; import { clearSessionQueues } from "./queue.js"; -import { resolveInternalSessionKey, resolveMainSessionAlias } from "../../agents/tools/sessions-helpers.js"; +import { + resolveInternalSessionKey, + resolveMainSessionAlias, +} from "../../agents/tools/sessions-helpers.js"; const ABORT_TRIGGERS = new Set(["stop", "esc", "abort", "wait", "exit", "interrupt"]); const ABORT_MEMORY = new Map(); diff --git a/src/auto-reply/reply/commands-session.ts b/src/auto-reply/reply/commands-session.ts index 60b201214..911c6a6a1 100644 --- a/src/auto-reply/reply/commands-session.ts +++ b/src/auto-reply/reply/commands-session.ts @@ -6,7 +6,12 @@ import { scheduleGatewaySigusr1Restart, triggerClawdbotRestart } from "../../inf import { parseAgentSessionKey } from "../../routing/session-key.js"; import { parseActivationCommand } from "../group-activation.js"; import { parseSendPolicyCommand } from "../send-policy.js"; -import { formatAbortReplyText, isAbortTrigger, setAbortMemory, stopSubagentsForRequester } from "./abort.js"; +import { + formatAbortReplyText, + isAbortTrigger, + setAbortMemory, + stopSubagentsForRequester, +} from "./abort.js"; import { clearSessionQueues } from "./queue.js"; import type { CommandHandler } from "./commands-types.js"; diff --git a/src/channels/mention-gating.ts b/src/channels/mention-gating.ts index 0dbf582f0..a2cc5a4d8 100644 --- a/src/channels/mention-gating.ts +++ b/src/channels/mention-gating.ts @@ -15,7 +15,6 @@ export function resolveMentionGating(params: MentionGateParams): MentionGateResu const implicit = params.implicitMention === true; const bypass = params.shouldBypassMention === true; const effectiveWasMentioned = params.wasMentioned || implicit || bypass; - const shouldSkip = - params.requireMention && params.canDetectMention && !effectiveWasMentioned; + const shouldSkip = params.requireMention && params.canDetectMention && !effectiveWasMentioned; return { effectiveWasMentioned, shouldSkip }; } diff --git a/src/discord/monitor/message-handler.preflight.ts b/src/discord/monitor/message-handler.preflight.ts index a2944be6f..3f6fa3cd6 100644 --- a/src/discord/monitor/message-handler.preflight.ts +++ b/src/discord/monitor/message-handler.preflight.ts @@ -167,9 +167,9 @@ export async function preflightDiscordMessage( matchesMentionPatterns(baseText, mentionRegexes)); const implicitMention = Boolean( !isDirectMessage && - botId && - message.referencedMessage?.author?.id && - message.referencedMessage.author.id === botId, + botId && + message.referencedMessage?.author?.id && + message.referencedMessage.author.id === botId, ); if (shouldLogVerbose()) { logVerbose( diff --git a/src/gateway/server-methods/sessions.ts b/src/gateway/server-methods/sessions.ts index fd4ab7163..94a3ca3f3 100644 --- a/src/gateway/server-methods/sessions.ts +++ b/src/gateway/server-methods/sessions.ts @@ -1,10 +1,7 @@ import { randomUUID } from "node:crypto"; import fs from "node:fs"; -import { - abortEmbeddedPiRun, - waitForEmbeddedPiRunEnd, -} from "../../agents/pi-embedded.js"; +import { abortEmbeddedPiRun, waitForEmbeddedPiRunEnd } from "../../agents/pi-embedded.js"; import { stopSubagentsForRequester } from "../../auto-reply/reply/abort.js"; import { clearSessionQueues } from "../../auto-reply/reply/queue.js"; import { loadConfig } from "../../config/config.js"; diff --git a/src/slack/monitor/message-handler/prepare.ts b/src/slack/monitor/message-handler/prepare.ts index 60a4c30a3..f284ec527 100644 --- a/src/slack/monitor/message-handler/prepare.ts +++ b/src/slack/monitor/message-handler/prepare.ts @@ -175,9 +175,9 @@ export async function prepareSlackMessage(params: { matchesMentionPatterns(message.text ?? "", mentionRegexes))); const implicitMention = Boolean( !isDirectMessage && - ctx.botUserId && - message.thread_ts && - message.parent_user_id === ctx.botUserId, + ctx.botUserId && + message.thread_ts && + message.parent_user_id === ctx.botUserId, ); const sender = message.user ? await ctx.resolveUserName(message.user) : null; diff --git a/src/web/auto-reply/monitor/group-gating.test.ts b/src/web/auto-reply/monitor/group-gating.test.ts index 91fe7cbb5..21e0b289d 100644 --- a/src/web/auto-reply/monitor/group-gating.test.ts +++ b/src/web/auto-reply/monitor/group-gating.test.ts @@ -16,7 +16,9 @@ describe("applyGroupGating", () => { it("treats reply-to-bot as implicit mention", () => { const groupHistories = new Map(); const result = applyGroupGating({ - cfg: baseConfig as unknown as ReturnType, + cfg: baseConfig as unknown as ReturnType< + typeof import("../../../config/config.js").loadConfig + >, msg: { id: "m1", from: "123@g.us", diff --git a/src/web/auto-reply/monitor/group-gating.ts b/src/web/auto-reply/monitor/group-gating.ts index 0af62b2c3..eeddc5c10 100644 --- a/src/web/auto-reply/monitor/group-gating.ts +++ b/src/web/auto-reply/monitor/group-gating.ts @@ -110,7 +110,7 @@ export function applyGroupGating(params: { : null; const implicitMention = Boolean( (selfJid && replySenderJid && selfJid === replySenderJid) || - (selfE164 && replySenderE164 && selfE164 === replySenderE164), + (selfE164 && replySenderE164 && selfE164 === replySenderE164), ); const mentionGate = resolveMentionGating({ requireMention,