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

@@ -1,10 +1,10 @@
import type { getReplyFromConfig } from "../../../auto-reply/reply.js";
import type { MsgContext } from "../../../auto-reply/templating.js";
import type { loadConfig } from "../../../config/config.js";
import type { MentionConfig } from "../mentions.js";
import type { WebInboundMsg } from "../types.js";
import type { EchoTracker } from "./echo.js";
import type { GroupHistoryEntry } from "./group-gating.js";
import { loadConfig } from "../../../config/config.js";
import { logVerbose } from "../../../globals.js";
import { resolveAgentRoute } from "../../../routing/resolve-route.js";
import { buildGroupHistoryKey } from "../../../routing/session-key.js";
@@ -63,8 +63,9 @@ export function createWebOnMessageHandler(params: {
return async (msg: WebInboundMsg) => {
const conversationId = msg.conversationId ?? msg.from;
const peerId = resolvePeerId(msg);
// Fresh config for bindings lookup; other routing inputs are payload-derived.
const route = resolveAgentRoute({
cfg: params.cfg,
cfg: loadConfig(),
channel: "whatsapp",
accountId: msg.accountId,
peer: {