fix(discord): add ackReactionScope channel override + off/none values (#28268)

This commit is contained in:
Ash (Bug Lab) 2026-03-01 12:19:39 +05:30 committed by Peter Steinberger
parent 60330e011b
commit 5b64b96c6c
9 changed files with 17 additions and 7 deletions

View File

@ -110,7 +110,7 @@ export type CoreConfig = {
};
messages?: {
ackReaction?: string;
ackReactionScope?: "group-mentions" | "group-all" | "direct" | "all";
ackReactionScope?: "group-mentions" | "group-all" | "direct" | "all" | "off" | "none";
};
[key: string]: unknown;
};

View File

@ -1361,7 +1361,7 @@ export const FIELD_HELP: Record<string, string> = {
"When true, suppress ⚠️ tool-error warnings from being shown to the user. The agent already sees errors in context and can retry. Default: false.",
"messages.ackReaction": "Emoji reaction used to acknowledge inbound messages (empty disables).",
"messages.ackReactionScope":
'When to send ack reactions ("group-mentions", "group-all", "direct", "all").',
'When to send ack reactions ("group-mentions", "group-all", "direct", "all", "off", "none"). "off"/"none" disables ack reactions entirely.',
"messages.statusReactions":
"Lifecycle status reactions that update the emoji on the trigger message as the agent progresses (queued → thinking → tool → done/error).",
"messages.statusReactions.enabled":

View File

@ -292,6 +292,8 @@ export type DiscordAccountConfig = {
* Discord supports both unicode emoji and custom emoji names.
*/
ackReaction?: string;
/** When to send ack reactions for this Discord account. Overrides messages.ackReactionScope. */
ackReactionScope?: "group-mentions" | "group-all" | "direct" | "all" | "off" | "none";
/** Bot activity status text (e.g. "Watching X"). */
activity?: string;
/** Bot status (online|dnd|idle|invisible). Defaults to online when presence is configured. */

View File

@ -112,7 +112,7 @@ export type MessagesConfig = {
/** Emoji reaction used to acknowledge inbound messages (empty disables). */
ackReaction?: string;
/** When to send ack reactions. Default: "group-mentions". */
ackReactionScope?: "group-mentions" | "group-all" | "direct" | "all";
ackReactionScope?: "group-mentions" | "group-all" | "direct" | "all" | "off" | "none";
/** Remove ack reaction after reply is sent (default: false). */
removeAckAfterReply?: boolean;
/** Lifecycle status reactions configuration. */

View File

@ -508,6 +508,9 @@ export const DiscordAccountSchema = z
.optional(),
responsePrefix: z.string().optional(),
ackReaction: z.string().optional(),
ackReactionScope: z
.enum(["group-mentions", "group-all", "direct", "all", "off", "none"])
.optional(),
activity: z.string().optional(),
status: z.enum(["online", "dnd", "idle", "invisible"]).optional(),
activityType: z

View File

@ -152,7 +152,9 @@ export const MessagesSchema = z
queue: QueueSchema,
inbound: InboundDebounceSchema,
ackReaction: z.string().optional(),
ackReactionScope: z.enum(["group-mentions", "group-all", "direct", "all"]).optional(),
ackReactionScope: z
.enum(["group-mentions", "group-all", "direct", "all", "off", "none"])
.optional(),
removeAckAfterReply: z.boolean().optional(),
statusReactions: z
.object({

View File

@ -30,7 +30,7 @@ export type DiscordMessagePreflightContext = {
mediaMaxBytes: number;
textLimit: number;
replyToMode: ReplyToMode;
ackReactionScope: "all" | "direct" | "group-all" | "group-mentions";
ackReactionScope: "all" | "direct" | "group-all" | "group-mentions" | "off" | "none";
groupPolicy: "open" | "disabled" | "allowlist";
data: DiscordMessageEvent;

View File

@ -29,7 +29,10 @@ export function createDiscordMessageHandler(
groupPolicy: params.discordConfig?.groupPolicy,
defaultGroupPolicy: params.cfg.channels?.defaults?.groupPolicy,
});
const ackReactionScope = params.cfg.messages?.ackReactionScope ?? "group-mentions";
const ackReactionScope =
params.discordConfig?.ackReactionScope ??
params.cfg.messages?.ackReactionScope ??
"group-mentions";
const debounceMs = resolveInboundDebounceMs({ cfg: params.cfg, channel: "discord" });
const debouncer = createInboundDebouncer<{ data: DiscordMessageEvent; client: Client }>({

View File

@ -112,7 +112,7 @@ export type BuildTelegramMessageContextParams = {
dmPolicy: DmPolicy;
allowFrom?: Array<string | number>;
groupAllowFrom?: Array<string | number>;
ackReactionScope: "off" | "group-mentions" | "group-all" | "direct" | "all";
ackReactionScope: "off" | "none" | "group-mentions" | "group-all" | "direct" | "all";
logger: TelegramLogger;
resolveGroupActivation: ResolveGroupActivation;
resolveGroupRequireMention: ResolveGroupRequireMention;