fix(discord): harden slash command routing

This commit is contained in:
Shadow
2026-03-03 11:22:32 -06:00
parent 0eef7a367d
commit b8b1eeb052
8 changed files with 290 additions and 4 deletions

View File

@@ -263,6 +263,14 @@ export async function preflightDiscordMessage(
const messageText = resolveDiscordMessageText(message, {
includeForwarded: true,
});
// Intercept text-only slash commands (e.g. user typing "/reset" instead of using Discord's slash command picker)
// These should not be forwarded to the agent; proper slash command interactions are handled elsewhere
if (!isDirectMessage && baseText && hasControlCommand(baseText, params.cfg)) {
logVerbose(`discord: drop text-based slash command ${message.id} (intercepted at gateway)`);
return null;
}
recordChannelActivity({
channel: "discord",
accountId: params.accountId,