fix(routing): make bindings dynamic by calling loadConfig() per-message (#11372)

This commit is contained in:
juanpablodlc
2026-02-08 22:34:55 -08:00
committed by GitHub
parent 0cf93b8fa7
commit 8d96955e19
6 changed files with 22 additions and 5 deletions

View File

@@ -17,6 +17,7 @@ import { formatAllowlistMatchMeta } from "../../channels/allowlist-match.js";
import { resolveControlCommandGate } from "../../channels/command-gating.js";
import { logInboundDrop } from "../../channels/logging.js";
import { resolveMentionGatingWithBypass } from "../../channels/mention-gating.js";
import { loadConfig } from "../../config/config.js";
import { logVerbose, shouldLogVerbose } from "../../globals.js";
import { recordChannelActivity } from "../../infra/channel-activity.js";
import { enqueueSystemEvent } from "../../infra/system-events.js";
@@ -218,8 +219,9 @@ export async function preflightDiscordMessage(
earlyThreadParentType = parentInfo.type;
}
// Fresh config for bindings lookup; other routing inputs are payload-derived.
const route = resolveAgentRoute({
cfg: params.cfg,
cfg: loadConfig(),
channel: "discord",
accountId: params.accountId,
guildId: params.data.guild_id ?? undefined,