From a6337be3d17477204dc9c0dfe6e6587942eab930 Mon Sep 17 00:00:00 2001 From: justinhuangcode Date: Tue, 24 Feb 2026 11:34:43 +0000 Subject: [PATCH] refactor: use MAX_SLACK_MEDIA_FILES constant for file-only fallback Replace the hardcoded limit of 5 with the existing MAX_SLACK_MEDIA_FILES constant (8) from media.ts for consistency. Co-Authored-By: Claude Opus 4.6 --- src/slack/monitor/media.ts | 2 +- src/slack/monitor/message-handler/prepare.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/slack/monitor/media.ts b/src/slack/monitor/media.ts index 964aec1107a..169e5571da0 100644 --- a/src/slack/monitor/media.ts +++ b/src/slack/monitor/media.ts @@ -131,7 +131,7 @@ export type SlackMediaResult = { placeholder: string; }; -const MAX_SLACK_MEDIA_FILES = 8; +export const MAX_SLACK_MEDIA_FILES = 8; const MAX_SLACK_MEDIA_CONCURRENCY = 3; const MAX_SLACK_FORWARDED_ATTACHMENTS = 8; diff --git a/src/slack/monitor/message-handler/prepare.ts b/src/slack/monitor/message-handler/prepare.ts index 0073de14d11..cd2b758cddb 100644 --- a/src/slack/monitor/message-handler/prepare.ts +++ b/src/slack/monitor/message-handler/prepare.ts @@ -44,6 +44,7 @@ import { stripSlackMentionsForCommandDetection } from "../commands.js"; import { normalizeSlackChannelType, type SlackMonitorContext } from "../context.js"; import { resolveSlackAttachmentContent, + MAX_SLACK_MEDIA_FILES, resolveSlackMedia, resolveSlackThreadHistory, resolveSlackThreadStarter, @@ -369,7 +370,7 @@ export async function prepareSlackMessage(params: { const fileOnlyFallback = !mediaPlaceholder && (message.files?.length ?? 0) > 0 ? message - .files!.slice(0, 5) + .files!.slice(0, MAX_SLACK_MEDIA_FILES) .map((f) => f.name ?? "file") .join(", ") : undefined;