fix: restore discord owner hint from allowlists

This commit is contained in:
Peter Steinberger
2026-02-04 23:34:08 -08:00
parent 8524666454
commit d84eb46467
8 changed files with 89 additions and 7 deletions

View File

@@ -50,6 +50,7 @@ import {
normalizeDiscordSlug,
resolveDiscordChannelConfigWithFallback,
resolveDiscordGuildEntry,
resolveDiscordOwnerAllowFrom,
resolveDiscordUserAllowed,
} from "./allow-list.js";
import { resolveDiscordChannelInfo } from "./message-utils.js";
@@ -741,6 +742,11 @@ async function dispatchDiscordCommandInteraction(params: {
parentPeer: threadParentId ? { kind: "channel", id: threadParentId } : undefined,
});
const conversationLabel = isDirectMessage ? (user.globalName ?? user.username) : channelId;
const ownerAllowFrom = resolveDiscordOwnerAllowFrom({
channelConfig,
guildInfo,
sender: { id: sender.id, name: sender.name, tag: sender.tag },
});
const ctxPayload = finalizeInboundContext({
Body: prompt,
RawBody: prompt,
@@ -778,6 +784,7 @@ async function dispatchDiscordCommandInteraction(params: {
return untrustedChannelMetadata ? [untrustedChannelMetadata] : undefined;
})()
: undefined,
OwnerAllowFrom: ownerAllowFrom,
SenderName: user.globalName ?? user.username,
SenderId: user.id,
SenderUsername: user.username,