chore: oxfmt

This commit is contained in:
Peter Steinberger
2026-01-16 22:33:35 +00:00
parent 548a32c8d4
commit 76d3d58b5c
8 changed files with 22 additions and 16 deletions

View File

@@ -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<string, boolean>();

View File

@@ -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";

View File

@@ -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 };
}

View File

@@ -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(

View File

@@ -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";

View File

@@ -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;

View File

@@ -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<typeof import("../../../config/config.js").loadConfig>,
cfg: baseConfig as unknown as ReturnType<
typeof import("../../../config/config.js").loadConfig
>,
msg: {
id: "m1",
from: "123@g.us",

View File

@@ -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,